Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

settings_ui: Use window controls on Linux (#40706)

Smit Barmase30f3152e65d0
diff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rs
index 138d54fc4a5..7d38ccd3678 100644
--- a/crates/settings_ui/src/settings_ui.rs
+++ b/crates/settings_ui/src/settings_ui.rs
@@ -474,6 +474,12 @@ pub fn open_settings_editor(
let scale_factor = current_rem_size / default_rem_size;
let scaled_bounds: gpui::Size<Pixels> = default_bounds.map(|axis| axis * scale_factor);
+ let window_decorations = match std::env::var("ZED_WINDOW_DECORATIONS") {
+ Ok(val) if val == "server" => gpui::WindowDecorations::Server,
+ Ok(val) if val == "client" => gpui::WindowDecorations::Client,
+ _ => gpui::WindowDecorations::Client,
+ };
+
cx.open_window(
WindowOptions {
titlebar: Some(TitlebarOptions {
@@ -486,6 +492,7 @@ pub fn open_settings_editor(
is_movable: true,
kind: gpui::WindowKind::Floating,
window_background: cx.theme().window_background_appearance(),
+ window_decorations: Some(window_decorations),
window_min_size: Some(scaled_bounds),
window_bounds: Some(WindowBounds::centered(scaled_bounds, cx)),
..Default::default()