Skip to content

Commit dd46645

Browse files
K-Blaaaackimsyy
authored andcommitted
fix: 修复窗口缩小时界面溢出与原生滚动条 fixes SPlayer-Dev#149
1 parent b480a1f commit dd46645

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

‎src/components/layout/NavHeader.vue‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ const onMenuSelect = (key: string): void => {
8080
>
8181
<template #icon><IconLucideChevronRight /></template>
8282
</SButton>
83-
<NavSearch />
8483
<SButton
8584
v-if="update.hasUpdate"
8685
class="app-no-drag"
@@ -94,8 +93,10 @@ const onMenuSelect = (key: string): void => {
9493
<template #icon><IconLucideCircleArrowUp /></template>
9594
</SButton>
9695
</div>
97-
<!-- 中间 -->
98-
<div class="flex-1 h-full" />
96+
<!-- 中间:搜索框,窄窗口下可收缩 -->
97+
<div class="flex-1 min-w-0 mx-3">
98+
<NavSearch />
99+
</div>
99100
<!-- 右侧 -->
100101
<div class="flex items-center gap-3 shrink-0">
101102
<NavUser />

‎src/components/layout/NavSearch.vue‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,12 @@ onMounted(() => {
275275
</script>
276276

277277
<template>
278-
<div class="flex items-center gap-2 shrink-0">
278+
<!-- 搜索框触发器与听歌识曲 -->
279+
<div class="flex items-center gap-2 min-w-0 w-full max-w-72">
279280
<div
280281
role="button"
281282
:aria-label="t('nav.searchPlaceholder')"
282-
class="app-no-drag w-60 h-10 px-4 cursor-pointer flex items-center gap-2 rounded-full border border-solid bg-on-surface/3 border-on-surface/15 hover:bg-on-surface/10 hover:border-on-surface/25 transition-colors duration-250 select-none"
283+
class="app-no-drag flex-1 w-full max-w-60 min-w-0 h-10 px-4 cursor-pointer flex items-center gap-2 rounded-full border border-solid bg-on-surface/3 border-on-surface/15 hover:bg-on-surface/10 hover:border-on-surface/25 transition-colors duration-250 select-none"
283284
@click="dialogOpen = true"
284285
@contextmenu.prevent="dialogOpen = true"
285286
@mousedown.prevent

‎src/layouts/MainLayout.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ const playerBarInnerClass = computed(() => {
114114
<template>
115115
<!-- 主界面 -->
116116
<div
117-
class="h-screen flex bg-app text-on-surface transition-[transform,opacity] duration-500 ease-[cubic-bezier(0.7,0,0.3,1)] origin-center"
117+
class="h-screen flex overflow-hidden bg-app text-on-surface transition-[transform,opacity] duration-500 ease-[cubic-bezier(0.7,0,0.3,1)] origin-center"
118118
:class="isPlayerExpanded ? 'scale-95 opacity-0 pointer-events-none' : ''"
119119
>
120120
<!-- 侧边栏 -->

‎src/styles/global.css‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ html[data-appearance-style="image"] [role="alertdialog"] .bg-field {
104104
/* 滚动条 */
105105
::-webkit-scrollbar {
106106
width: 6px;
107+
height: 6px;
107108
}
108109

109110
::-webkit-scrollbar-track {

0 commit comments

Comments
 (0)