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.

Revert "settings_ui: Shrink constraint on minimum window width (#60786)" (#60903)

Danilo Leal6b2857feab4a
diff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rs
index b3c0b5b337b..96ebc5f34c7 100644
--- a/crates/settings_ui/src/settings_ui.rs
+++ b/crates/settings_ui/src/settings_ui.rs
@@ -73,6 +73,9 @@ const HEADER_GROUP_TAB_INDEX: isize = 3;
const CONTENT_CONTAINER_TAB_INDEX: isize = 4;
const CONTENT_GROUP_TAB_INDEX: isize = 5;
+const SIDEBAR_WIDTH: Pixels = px(226.);
+const CONTENT_MIN_WIDTH: Pixels = px(400.);
+
actions!(
settings_editor,
[
@@ -870,7 +873,11 @@ fn open_settings_editor_with(
app_id: Some(app_id.to_owned()),
window_decorations: Some(window_decorations),
window_min_size: Some(gpui::Size {
- width: px(360.0),
+ // Do not make the settings window thinner than this,
+ // otherwise, the space used to display the actual content
+ // gets so small that certain sections grow too tall due
+ // to intense text wrapping.
+ width: SIDEBAR_WIDTH + CONTENT_MIN_WIDTH,
height: px(240.0),
}),
window_bounds: Some(WindowBounds::centered(scaled_bounds, cx)),
@@ -3131,7 +3138,7 @@ impl SettingsWindow {
cx,
);
}))
- .w_56()
+ .w(SIDEBAR_WIDTH)
.h_full()
.p_2p5()
.when(cfg!(target_os = "macos"), |this| this.pt_10())