BlueGit

ict rusty-teams

fix(ui): line-free shell edges, centered title bar, Windows-size caption buttons

- remove the title bar bottom line and the status bar top line
- islands start right under the title bar and end on the status bar, 6 px grid kept
- search box and own avatar centered in the full 40 px title bar
- caption buttons 46 px wide with a 10 px glyph like Windows 11

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

metis Daniel Däschle · pushed by metis

Authored 2026-10-17 · 6 weeks ago

Hash
c9ae8c7b54194089a7e52caf3c24eddfb192da75
Parent
3a26cce4
4 files changed +8 −8
crates/app/src/views/shell.rs +0 −1
@@ -721,7 +721,6 @@ impl AppShell {
721 721 .w_full()
722 722 .gap(px(ISLAND_GAP))
723 723 .pr(px(ISLAND_GAP))
724 .py(px(ISLAND_GAP))
725 724 .child(
726 725 h_flex()
727 726 .h_full()
@@ -721,7 +721,6 @@ impl AppShell {
721 .w_full()
721 .w_full()
722 .gap(px(ISLAND_GAP))
722 .gap(px(ISLAND_GAP))
723 .pr(px(ISLAND_GAP))
723 .pr(px(ISLAND_GAP))
724 .py(px(ISLAND_GAP))
725 .child(
724 .child(
726 h_flex()
725 h_flex()
727 .h_full()
726 .h_full()
crates/app/src/views/status_bar.rs +0 −2
@@ -80,8 +80,6 @@ pub fn render_status_bar(
80 80 .items_center()
81 81 .text_size(px(11.))
82 82 .bg(theme::background())
83 .border_t_1()
84 .border_color(theme::border())
85 83 .text_color(theme::text_muted());
86 84 match live {
87 85 Some((label, tone)) if connection_tone == Tone::Good => {
@@ -80,8 +80,6 @@ pub fn render_status_bar(
80 .items_center()
80 .items_center()
81 .text_size(px(11.))
81 .text_size(px(11.))
82 .bg(theme::background())
82 .bg(theme::background())
83 .border_t_1()
84 .border_color(theme::border())
85 .text_color(theme::text_muted());
83 .text_color(theme::text_muted());
86 match live {
84 match live {
87 Some((label, tone)) if connection_tone == Tone::Good => {
85 Some((label, tone)) if connection_tone == Tone::Good => {
crates/app/src/views/title_bar.rs +1 −0
@@ -52,6 +52,7 @@ pub fn render_title_bar(
52 52 .on_click(on_search);
53 53 let bar = TitleBar::new()
54 54 .h(px(TITLE_BAR_HEIGHT))
55 .border_b_0()
55 56 .bg(theme::background())
56 57 .child(
57 58 h_flex()
@@ -52,6 +52,7 @@ pub fn render_title_bar(
52 .on_click(on_search);
52 .on_click(on_search);
53 let bar = TitleBar::new()
53 let bar = TitleBar::new()
54 .h(px(TITLE_BAR_HEIGHT))
54 .h(px(TITLE_BAR_HEIGHT))
55 .border_b_0()
55 .bg(theme::background())
56 .bg(theme::background())
56 .child(
57 .child(
57 h_flex()
58 h_flex()
vendor/gpui-component/src/title_bar.rs +7 −5
@@ -1,7 +1,7 @@
1 1 use std::rc::Rc;
2 2
3 3 use crate::{
4 ActiveTheme, Icon, IconName, InteractiveElementExt as _, Sizable as _, StyledExt, h_flex,
4 ActiveTheme, Icon, IconName, InteractiveElementExt as _, StyledExt, h_flex,
5 5 };
6 6 use gpui::{
7 7 AnyElement, App, Background, ClickEvent, Context, Decorations, Hsla, InteractiveElement,
@@ -17,6 +17,10 @@ pub const TITLE_BAR_HEIGHT: Pixels = px(34.);
17 17 const TITLE_BAR_LEFT_PADDING: Pixels = px(80.);
18 18 #[cfg(not(target_os = "macos"))]
19 19 const TITLE_BAR_LEFT_PADDING: Pixels = px(12.);
20 /// Windows 11 caption button width at 100% scale.
21 const CONTROL_BUTTON_WIDTH: Pixels = px(46.);
22 /// Box that renders the 16/24 window glyphs 10 px wide, like Segoe Fluent Icons at 10 px.
23 const CONTROL_ICON_SIZE: Pixels = px(15.);
20 24
21 25 fn default_title_bar_background(title_bar: Hsla, background: Hsla) -> Background {
22 26 let title_bar_rgb = title_bar.to_rgb();
@@ -103,8 +107,6 @@ impl TitleBar {
103 107 }
104 108 }
105 109
106 // The Windows control buttons have a fixed width of 35px.
107 //
108 110 // We don't need implementation the click event for the control buttons.
109 111 // If user clicked in the bounds, the window event will be triggered.
110 112 #[derive(IntoElement, Clone)]
@@ -208,7 +210,7 @@ impl RenderOnce for ControlIcon {
208 210 div()
209 211 .id(self.id())
210 212 .flex()
211 .w(TITLE_BAR_HEIGHT)
213 .w(CONTROL_BUTTON_WIDTH)
212 214 .h_full()
213 215 .flex_shrink_0()
214 216 .justify_center()
@@ -240,7 +242,7 @@ impl RenderOnce for ControlIcon {
240 242 }
241 243 })
242 244 })
243 .child(Icon::new(self.icon()).small())
245 .child(Icon::new(self.icon()).size(CONTROL_ICON_SIZE))
244 246 }
245 247 }
246 248
@@ -1,7 +1,7 @@
1use std::rc::Rc;
1use std::rc::Rc;
2
2
3use crate::{
3use crate::{
4 ActiveTheme, Icon, IconName, InteractiveElementExt as _, Sizable as _, StyledExt, h_flex,
4 ActiveTheme, Icon, IconName, InteractiveElementExt as _, StyledExt, h_flex,
5};
5};
6use gpui::{
6use gpui::{
7 AnyElement, App, Background, ClickEvent, Context, Decorations, Hsla, InteractiveElement,
7 AnyElement, App, Background, ClickEvent, Context, Decorations, Hsla, InteractiveElement,
@@ -17,6 +17,10 @@ pub const TITLE_BAR_HEIGHT: Pixels = px(34.);
17const TITLE_BAR_LEFT_PADDING: Pixels = px(80.);
17const TITLE_BAR_LEFT_PADDING: Pixels = px(80.);
18#[cfg(not(target_os = "macos"))]
18#[cfg(not(target_os = "macos"))]
19const TITLE_BAR_LEFT_PADDING: Pixels = px(12.);
19const TITLE_BAR_LEFT_PADDING: Pixels = px(12.);
20/// Windows 11 caption button width at 100% scale.
21const CONTROL_BUTTON_WIDTH: Pixels = px(46.);
22/// Box that renders the 16/24 window glyphs 10 px wide, like Segoe Fluent Icons at 10 px.
23const CONTROL_ICON_SIZE: Pixels = px(15.);
20
24
21fn default_title_bar_background(title_bar: Hsla, background: Hsla) -> Background {
25fn default_title_bar_background(title_bar: Hsla, background: Hsla) -> Background {
22 let title_bar_rgb = title_bar.to_rgb();
26 let title_bar_rgb = title_bar.to_rgb();
@@ -103,8 +107,6 @@ impl TitleBar {
103 }
107 }
104}
108}
105
109
106// The Windows control buttons have a fixed width of 35px.
107//
108// We don't need implementation the click event for the control buttons.
110// We don't need implementation the click event for the control buttons.
109// If user clicked in the bounds, the window event will be triggered.
111// If user clicked in the bounds, the window event will be triggered.
110#[derive(IntoElement, Clone)]
112#[derive(IntoElement, Clone)]
@@ -208,7 +210,7 @@ impl RenderOnce for ControlIcon {
208 div()
210 div()
209 .id(self.id())
211 .id(self.id())
210 .flex()
212 .flex()
211 .w(TITLE_BAR_HEIGHT)
213 .w(CONTROL_BUTTON_WIDTH)
212 .h_full()
214 .h_full()
213 .flex_shrink_0()
215 .flex_shrink_0()
214 .justify_center()
216 .justify_center()
@@ -240,7 +242,7 @@ impl RenderOnce for ControlIcon {
240 }
242 }
241 })
243 })
242 })
244 })
243 .child(Icon::new(self.icon()).small())
245 .child(Icon::new(self.icon()).size(CONTROL_ICON_SIZE))
244 }
246 }
245}
247}
246
248