feat: 侧边栏新增位置兼容模式,为 Windows 原生标题栏预留顶部空间

新增 SidebarPrefs.titleBarCompat 设置项(默认关闭):开启后 toggle cluster
下移 40px、右侧面板内容从标题栏条带下方开始,避免被 Windows 无边框窗口
右上角的原生标题栏遮挡。底部面板不受影响。设置页「常规」新增一行开关,
zh/en 双语,读写下穿既有 settings 路由。测试覆盖 parsePrefs 回退、schema
默认值、设置页渲染与开关状态。
This commit is contained in:
Menghuan1918
2026-08-15 15:24:46 +08:00
parent 1a0d530711
commit ae71aecb83
11 changed files with 104 additions and 5 deletions
+22
View File
@@ -209,6 +209,28 @@
padding-right: 40px;
}
/* ── Position compatibility mode (Windows native title bar) ────────────── */
/* Windows frameless / hidden-title-bar windows draw the native caption
strip (minimize / maximize / close) at the window's top-right corner,
OVER the web content. When the user enables the "position compatibility"
pref, the sidebar yields the strip: the toggle cluster drops below it and
the right panel's content starts below it — the panel's surface still
spans the full height, so the caption buttons float over empty sidebar
fill (the VSCode hidden-title-bar look). The bottom panel is unaffected:
it sits at the window's bottom, never under the top strip. The Sidebar
shell toggles the body attribute from the prefs. */
:global(body[data-dsh-title-bar-compat]) .toggleCluster {
top: 43px; /* 40px caption strip + the original 3px inset */
}
:global(body[data-dsh-title-bar-compat]) .panel {
/* The caption strip is drawn over the panel's own top edge: keep the
surface full-height and push the content (the tab strip) below the
strip instead. .panelResize is absolutely positioned and unaffected. */
padding-top: 40px;
}
/* The shared corner (both panels open): the intersection of the right
panel's left edge and the bottom panel's top edge. Horizontal drags
resize the width, vertical drags the height — the two panels drag