feat(ui): 文件树头部操作钮分左右两组
五个图标钮原来全挤在右端(显示隐藏文件 / 刷新 / Git / Finder / 终端), 一排点下来容易点到隔壁,刷新和 Git 面板尤其挨得近。 现在左边一组是树内只读操作(显示隐藏文件、刷新、Git),右边一组是拉到外部 打开(Finder、终端,仅本地模式出现),两端由 space-between 拉开,组内间距仍按 侧栏收紧成 4px。没动机器行为,只多包一层 span 加两条覆盖规则。
This commit is contained in:
@@ -884,7 +884,9 @@ body.voice-active .scroll-bottom-btn { display: none; }
|
||||
/* 左栏树头部复用预览栏的 .pv-head / .pv-actions / .icon-btn:
|
||||
它俩在桌面上左右并排,高一点点或图标小一号都会明显错位。
|
||||
不放地址条:侧栏只有 280px,路径必然被截断,没有信息量。 */
|
||||
.tree-head .pv-actions { gap: 4px; margin-left: auto; } /* 靠右,与预览栏的操作钮同一侧 */
|
||||
/* 操作钮分两组分居两端:左边是树内只读操作(显示隐藏文件/刷新/Git),右边是外部打开 */
|
||||
.tree-head { justify-content: space-between; }
|
||||
.tree-head .pv-actions { gap: 4px; margin-left: 0; } /* 组内间距按侧栏收紧;两端由 space-between 拉开 */
|
||||
/* 头部图标的「开启中」态(如显示隐藏文件) */
|
||||
.pv-actions .icon-btn.active { color: var(--active); background: var(--active-soft); }
|
||||
|
||||
|
||||
@@ -402,14 +402,18 @@
|
||||
|
||||
// 头部直接复用预览栏的 .pv-head / .pv-actions / .icon-btn:
|
||||
// 两者在桌面上左右并排,尺寸/描边/内边距必须一模一样,否则一眼就看出错位。
|
||||
// 不放地址条(路径在 280px 里必然截断,没有信息量),所以只剩右侧操作钮。
|
||||
// 不放地址条(路径在 280px 里必然截断,没有信息量)。
|
||||
// 操作钮按用途分两组:左边是树内的只读操作(显示隐藏文件 / 刷新 / Git 面板),
|
||||
// 右边是拉到外部打开(Finder / 终端,仅本地模式出现)。两组分居两端,连点不易误触。
|
||||
const head = document.createElement('header');
|
||||
head.className = 'pv-head tree-head';
|
||||
head.innerHTML =
|
||||
'<span class="pv-actions">' +
|
||||
'<span class="pv-actions tree-actions-main">' +
|
||||
'<button class="icon-btn" type="button" id="tree-hidden" title="显示隐藏文件" aria-label="显示隐藏文件">' + SVG_EYE + '</button>' +
|
||||
'<button class="icon-btn" type="button" id="tree-refresh" title="刷新" aria-label="刷新">' + SVG_REFRESH + '</button>' +
|
||||
'<button class="icon-btn" type="button" id="tree-vcs" title="Git 改动与历史" aria-label="Git 改动与历史">' + SVG_VCS + '</button>' +
|
||||
'</span>' +
|
||||
'<span class="pv-actions tree-actions-ext">' +
|
||||
'<button class="icon-btn hidden" type="button" id="tree-reveal" title="在 Finder 中打开" aria-label="在 Finder 中打开">' + SVG_REVEAL + '</button>' +
|
||||
'<button class="icon-btn hidden" type="button" id="tree-terminal" title="在终端中打开" aria-label="在终端中打开">' + SVG_TERM + '</button>' +
|
||||
'</span>';
|
||||
|
||||
Reference in New Issue
Block a user