Skip to content

Commit

Permalink
linux: Fix window border on Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Dec 24, 2024
1 parent ea0954b commit 7d8166a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/story/examples/tiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ impl StoryTiles {
height: px(480.),
}),
kind: WindowKind::Normal,
#[cfg(target_os = "linux")]
window_background: gpui::WindowBackgroundAppearance::Transparent,
#[cfg(target_os = "linux")]
window_decorations: Some(gpui::WindowDecorations::Client),
..Default::default()
};

Expand Down Expand Up @@ -218,8 +222,12 @@ impl Render for StoryTiles {
let drawer_layer = Root::render_drawer_layer(cx);
let modal_layer = Root::render_modal_layer(cx);
let notification_layer = Root::render_notification_layer(cx);
let is_linux = cfg!(target_os = "linux");

div()
.when(is_linux, |this| {
this.border_1().border_color(cx.theme().border)
})
.font_family(".SystemUIFont")
.relative()
.size_full()
Expand Down
8 changes: 8 additions & 0 deletions crates/story/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@ impl StoryWorkspace {
width: px(640.),
height: px(480.),
}),
#[cfg(target_os = "linux")]
window_background: gpui::WindowBackgroundAppearance::Transparent,
#[cfg(target_os = "linux")]
window_decorations: Some(gpui::WindowDecorations::Client),
kind: WindowKind::Normal,
..Default::default()
};
Expand Down Expand Up @@ -446,9 +450,13 @@ impl Render for StoryWorkspace {
let notification_layer = Root::render_notification_layer(cx);
let notifications_count = cx.notifications().len();
let invisible_panels = AppState::global(cx).invisible_panels.clone();
let is_linux = cfg!(target_os = "linux");

div()
.id("story-workspace")
.when(is_linux, |this| {
this.border_1().border_color(cx.theme().border)
})
.on_action(cx.listener(Self::on_action_add_panel))
.on_action(cx.listener(Self::on_action_toggle_panel_visible))
.relative()
Expand Down

0 comments on commit 7d8166a

Please sign in to comment.