Skip to content

Commit e73be0d

Browse files
authored
fix(sidebar): separate the tab color strip from its icon
Keep rem-based row padding and anchor the tab color strip to the row edge.
1 parent 9c56af8 commit e73be0d

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎nebula_app/src/gpui_shell/workspace/sidebar.rs‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,13 @@ impl NebulaWorkspace {
254254
row_w * 0.45,
255255
);
256256
let cross_window_drag = self.cross_window_drag_payload(ix, cx);
257-
// 用户明确设置过的标签色:行左侧一条竖光条(旧壳 strip,位置与
258-
// 尺寸同源:左内缩 4、上下各留 7、宽 2.5)。默认标签不占这层
259-
// 视觉层级。
257+
// 用户明确设置过的标签色:行左侧一条竖光条(上下各留 7、宽 2.5,
258+
// 与旧壳 strip 同源)。默认标签不占这层视觉层级。
259+
//
260+
// 光条贴住行左缘,不沿用旧壳的左内缩 4:旧壳内容起点是 14px,这里
261+
// 是 `px_2` = 0.5rem,rem 跟随界面字号(默认 14 → 7px,最小 10 →
262+
// 5px)。内缩会让光条贴上图标;贴边时间隙就是内边距减光条宽,随
263+
// 字号一起缩放。
260264
let strip = tab_color.map(|color| gpui::Rgba {
261265
r: color.r as f32 / 255.0,
262266
g: color.g as f32 / 255.0,
@@ -416,7 +420,7 @@ impl NebulaWorkspace {
416420
row.child(
417421
div()
418422
.absolute()
419-
.left(px(4.0))
423+
.left_0()
420424
.top(px(7.0))
421425
.w(px(2.5))
422426
.h(px(row_height - 14.0))

0 commit comments

Comments
 (0)