feat: 优化窗口标题栏和设置页面UI
- 移除WindowTitlbar组件中的装饰点元素及其相关样式 - 在MainLayout中添加flex占位符以改善布局结构 - 更新组件类型定义,添加Naive UI组件类型声明 - 重构SettingsView使用Naive UI布局组件,提升响应式体验 - 移除过时的侧边栏描述文本和样式配置 - 调整菜单选中状态的视觉效果
This commit is contained in:
parent
cc2fdfa04f
commit
6593225d0f
|
|
@ -1,7 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<header class="window-titlebar" :class="{ 'window-titlebar--macos': isMacos }">
|
<header class="window-titlebar" :class="{ 'window-titlebar--macos': isMacos }">
|
||||||
<div class="window-titlebar__drag" data-tauri-drag-region>
|
<div class="window-titlebar__drag" data-tauri-drag-region>
|
||||||
<!-- <span class="window-titlebar__dot"></span> -->
|
|
||||||
<span class="window-titlebar__title">YwYMusic</span>
|
<span class="window-titlebar__title">YwYMusic</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -72,15 +71,6 @@ function closeWindow() {
|
||||||
padding-left: 14px;
|
padding-left: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.window-titlebar__dot {
|
|
||||||
width: 9px;
|
|
||||||
height: 9px;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
border-radius: 999px;
|
|
||||||
background: linear-gradient(135deg, #d98b5f 0%, var(--app-primary) 100%);
|
|
||||||
box-shadow: 0 0 0 3px rgba(180, 83, 42, 0.12);
|
|
||||||
}
|
|
||||||
|
|
||||||
.window-titlebar__title {
|
.window-titlebar__title {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
@ -124,7 +114,7 @@ function closeWindow() {
|
||||||
}
|
}
|
||||||
|
|
||||||
.window-titlebar--macos .window-titlebar__controls,
|
.window-titlebar--macos .window-titlebar__controls,
|
||||||
.window-titlebar--macos .window-titlebar__dot {
|
.window-titlebar--macos {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@
|
||||||
@update:value="handleMenuSelect"
|
@update:value="handleMenuSelect"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<div class="flex"></div>
|
||||||
|
|
||||||
<div class="nav-settings">
|
<div class="nav-settings">
|
||||||
<n-menu
|
<n-menu
|
||||||
:collapsed="collapsed"
|
:collapsed="collapsed"
|
||||||
|
|
@ -191,10 +193,14 @@ watch(
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.flex {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.nav-settings {
|
.nav-settings {
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
padding-top: 12px;
|
/* padding-top: 12px;
|
||||||
border-top: 1px solid var(--app-border);
|
border-top: 1px solid var(--app-border); */
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-settings--collapsed {
|
.nav-settings--collapsed {
|
||||||
|
|
|
||||||
|
|
@ -15,17 +15,24 @@ declare module 'vue' {
|
||||||
FullscreenPlayer: typeof import('./../components/FullscreenPlayer.vue')['default']
|
FullscreenPlayer: typeof import('./../components/FullscreenPlayer.vue')['default']
|
||||||
MusicCard: typeof import('./../components/MusicCard.vue')['default']
|
MusicCard: typeof import('./../components/MusicCard.vue')['default']
|
||||||
NBackTop: typeof import('naive-ui')['NBackTop']
|
NBackTop: typeof import('naive-ui')['NBackTop']
|
||||||
|
NButton: typeof import('naive-ui')['NButton']
|
||||||
NCheckbox: typeof import('naive-ui')['NCheckbox']
|
NCheckbox: typeof import('naive-ui')['NCheckbox']
|
||||||
|
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
||||||
|
NDialogProvider: typeof import('naive-ui')['NDialogProvider']
|
||||||
|
NIcon: typeof import('naive-ui')['NIcon']
|
||||||
NLayout: typeof import('naive-ui')['NLayout']
|
NLayout: typeof import('naive-ui')['NLayout']
|
||||||
NLayoutContent: typeof import('naive-ui')['NLayoutContent']
|
NLayoutContent: typeof import('naive-ui')['NLayoutContent']
|
||||||
NLayoutFooter: typeof import('naive-ui')['NLayoutFooter']
|
NLayoutFooter: typeof import('naive-ui')['NLayoutFooter']
|
||||||
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
||||||
NMenu: typeof import('naive-ui')['NMenu']
|
NMenu: typeof import('naive-ui')['NMenu']
|
||||||
|
NMessageProvider: typeof import('naive-ui')['NMessageProvider']
|
||||||
|
NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
|
||||||
NRadio: typeof import('naive-ui')['NRadio']
|
NRadio: typeof import('naive-ui')['NRadio']
|
||||||
PlayerBar: typeof import('./../components/PlayerBar.vue')['default']
|
PlayerBar: typeof import('./../components/PlayerBar.vue')['default']
|
||||||
QrLogin: typeof import('./../components/QrLogin.vue')['default']
|
QrLogin: typeof import('./../components/QrLogin.vue')['default']
|
||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
RouterView: typeof import('vue-router')['RouterView']
|
RouterView: typeof import('vue-router')['RouterView']
|
||||||
SongTable: typeof import('./../components/SongTable.vue')['default']
|
SongTable: typeof import('./../components/SongTable.vue')['default']
|
||||||
|
WindowTitlebar: typeof import('./../components/WindowTitlebar.vue')['default']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,23 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="settings-layout">
|
<n-layout class="settings-layout" has-sider>
|
||||||
<aside class="settings-sidebar">
|
<n-layout-sider
|
||||||
<!-- <div class="settings-heading">
|
class="settings-sidebar"
|
||||||
<span class="settings-eyebrow">PREFERENCES</span>
|
:width="150"
|
||||||
<h2>设置</h2>
|
:native-scrollbar="false"
|
||||||
<p>管理应用偏好与播放体验</p>
|
:bordered="false"
|
||||||
</div> -->
|
>
|
||||||
|
|
||||||
<n-menu
|
<n-menu
|
||||||
:value="activeSetting"
|
:value="activeSetting"
|
||||||
:options="settingOptions"
|
:options="settingOptions"
|
||||||
class="settings-menu"
|
class="settings-menu"
|
||||||
@update:value="handleSettingChange"
|
@update:value="handleSettingChange"
|
||||||
/>
|
/>
|
||||||
</aside>
|
</n-layout-sider>
|
||||||
|
|
||||||
<main class="settings-content">
|
<n-layout-content class="settings-content" :native-scrollbar="false">
|
||||||
<RouterView />
|
<RouterView />
|
||||||
</main>
|
</n-layout-content>
|
||||||
</div>
|
</n-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
@ -33,13 +32,11 @@ const settingOptions: MenuOption[] = [
|
||||||
{
|
{
|
||||||
label: "音乐源",
|
label: "音乐源",
|
||||||
key: "settings-source",
|
key: "settings-source",
|
||||||
description: "搜索与解析来源",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "外观",
|
label: "外观",
|
||||||
key: "settings-appearance",
|
key: "settings-appearance",
|
||||||
description: "主题与布局设置",
|
},
|
||||||
}
|
|
||||||
]
|
]
|
||||||
|
|
||||||
const activeSetting = computed(() => String(route.name ?? "settings-source"))
|
const activeSetting = computed(() => String(route.name ?? "settings-source"))
|
||||||
|
|
@ -51,46 +48,23 @@ function handleSettingChange(key: string) {
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.settings-layout {
|
.settings-layout {
|
||||||
display: grid;
|
width: 100%;
|
||||||
grid-template-columns: 190px minmax(0, 1fr);
|
|
||||||
gap: clamp(24px, 4vw, 52px);
|
|
||||||
max-width: 1180px;
|
max-width: 1180px;
|
||||||
|
height: 100%;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-sidebar {
|
.settings-sidebar {
|
||||||
position: sticky;
|
flex: 0 0 190px;
|
||||||
top: 0;
|
min-height: 0;
|
||||||
align-self: start;
|
padding: 0 12px 0 0;
|
||||||
}
|
background: transparent;
|
||||||
|
|
||||||
.settings-heading {
|
|
||||||
margin-bottom: 22px;
|
|
||||||
padding: 4px 12px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-eyebrow {
|
|
||||||
color: var(--app-primary);
|
|
||||||
font-size: 10px;
|
|
||||||
font-weight: 700;
|
|
||||||
letter-spacing: 1.6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-heading h2 {
|
|
||||||
margin: 5px 0 4px;
|
|
||||||
font-size: 26px;
|
|
||||||
line-height: 1.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-heading p {
|
|
||||||
margin: 0;
|
|
||||||
color: var(--app-text-muted);
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1.6;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-menu {
|
.settings-menu {
|
||||||
|
width: 100%;
|
||||||
--n-item-text-color: var(--app-text-secondary);
|
--n-item-text-color: var(--app-text-secondary);
|
||||||
--n-item-text-color-hover: var(--app-text);
|
--n-item-text-color-hover: var(--app-text);
|
||||||
--n-item-text-color-active: var(--app-primary);
|
--n-item-text-color-active: var(--app-primary);
|
||||||
|
|
@ -98,22 +72,39 @@ function handleSettingChange(key: string) {
|
||||||
--n-item-color-active-hover: rgba(180, 83, 42, 0.16);
|
--n-item-color-active-hover: rgba(180, 83, 42, 0.16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.settings-menu :deep(.n-menu-item-content) {
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-menu :deep(.n-menu-item-content:hover),
|
||||||
|
.settings-menu :deep(.n-menu-item-content--selected),
|
||||||
|
.settings-menu :deep(.n-menu-item-content::before),
|
||||||
|
.settings-menu :deep(.n-menu-item-content:hover::before),
|
||||||
|
.settings-menu :deep(.n-menu-item-content--selected::before) {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-menu :deep(.n-menu-item-content--selected) {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
.settings-content {
|
.settings-content {
|
||||||
|
min-height: 0;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 760px) {
|
@media (max-width: 760px) {
|
||||||
.settings-layout {
|
.settings-layout {
|
||||||
grid-template-columns: 1fr;
|
display: block;
|
||||||
gap: 18px;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-sidebar {
|
.settings-sidebar {
|
||||||
position: static;
|
width: 100%;
|
||||||
}
|
height: auto;
|
||||||
|
padding: 0 0 18px;
|
||||||
.settings-heading {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-menu {
|
.settings-menu {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue