Skip to content

Commit 6acbfb5

Browse files
committed
root: Fix window border and add cx.theme().window_border
1 parent 466c5e2 commit 6acbfb5

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

crates/story/examples/tiles.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,8 @@ impl Render for StoryTiles {
223223
let drawer_layer = Root::render_drawer_layer(cx);
224224
let modal_layer = Root::render_modal_layer(cx);
225225
let notification_layer = Root::render_notification_layer(cx);
226-
let is_linux = cfg!(target_os = "linux");
227226

228227
div()
229-
.when(is_linux, |this| {
230-
this.border_1().border_color(cx.theme().border)
231-
})
232228
.font_family(".SystemUIFont")
233229
.relative()
234230
.size_full()

crates/story/src/main.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,9 @@ impl Render for StoryWorkspace {
451451
let notification_layer = Root::render_notification_layer(cx);
452452
let notifications_count = cx.notifications().len();
453453
let invisible_panels = AppState::global(cx).invisible_panels.clone();
454-
let is_linux = cfg!(target_os = "linux");
455454

456455
div()
457456
.id("story-workspace")
458-
.when(is_linux, |this| {
459-
this.border_1().border_color(cx.theme().border)
460-
})
461457
.on_action(cx.listener(Self::on_action_add_panel))
462458
.on_action(cx.listener(Self::on_action_toggle_panel_visible))
463459
.relative()

crates/ui/src/theme.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ pub struct ThemeColor {
155155
pub accordion_hover: Hsla,
156156
pub background: Hsla,
157157
pub border: Hsla,
158+
pub window_border: Hsla,
158159
pub card: Hsla,
159160
pub card_foreground: Hsla,
160161
pub destructive: Hsla,
@@ -230,6 +231,7 @@ impl ThemeColor {
230231
accordion_hover: hsl(240.0, 4.8, 95.9).opacity(0.7),
231232
background: hsl(0.0, 0.0, 100.),
232233
border: hsl(240.0, 5.9, 90.0),
234+
window_border: hsl(240.0, 5.9, 78.0),
233235
card: hsl(0.0, 0.0, 100.0),
234236
card_foreground: hsl(240.0, 10.0, 3.9),
235237
destructive: hsl(0.0, 84.2, 60.2),
@@ -305,6 +307,7 @@ impl ThemeColor {
305307
accordion_hover: hsl(240.0, 3.7, 15.9).opacity(0.7),
306308
background: hsl(0.0, 0.0, 8.0),
307309
border: hsl(240.0, 3.7, 16.9),
310+
window_border: hsl(240.0, 3.7, 28.0),
308311
card: hsl(0.0, 0.0, 8.0),
309312
card_foreground: hsl(0.0, 0.0, 78.0),
310313
destructive: hsl(0.0, 62.8, 30.6),

crates/ui/src/window_border.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ use gpui::{
66
Point, RenderOnce, ResizeEdge, Size, Styled as _, WindowContext,
77
};
88

9+
use crate::theme::ActiveTheme;
10+
911
const SHADOW_SIZE: Pixels = Pixels(12.0);
10-
const BORDER_SIZE: Pixels = Pixels(0.0);
12+
const BORDER_SIZE: Pixels = Pixels(1.0);
1113
pub(crate) const BORDER_RADIUS: Pixels = Pixels(0.0);
1214

1315
/// Create a new window border.
@@ -120,6 +122,7 @@ impl RenderOnce for WindowBorder {
120122
.when(!(tiling.top || tiling.left), |div| {
121123
div.rounded_tl(BORDER_RADIUS)
122124
})
125+
.border_color(cx.theme().window_border)
123126
.when(!tiling.top, |div| div.border_t(BORDER_SIZE))
124127
.when(!tiling.bottom, |div| div.border_b(BORDER_SIZE))
125128
.when(!tiling.left, |div| div.border_l(BORDER_SIZE))

0 commit comments

Comments
 (0)