T33: the sessions and right columns resize by a drag on their border toward the terminal, 160 to 960 pixels, kept in the settings once a drag rests; Ely 5c2822c's resizable ShellColumn, whose handle occludes the header so the drag moves no window, and Ely 005faef's handle line, a filled hairline, since gpui paints a border no wider than half its box
This commit is contained in:
8 files changed
+111
-11
No files matched your search
@@ -75,6 +75,9 @@ pub struct Settings {
|
||||
pub show_sessions: bool,
|
||||
pub show_panel: bool,
|
||||
pub panel: PanelTab,
|
||||
/// The sessions and right columns' widths, in pixels, as their borders were dragged.
|
||||
pub sessions_width: f32,
|
||||
pub panel_width: f32,
|
||||
/// The main window's size, unmaximized, in pixels.
|
||||
pub window_width: f32,
|
||||
pub window_height: f32,
|
||||
@@ -103,6 +106,8 @@ impl Default for Settings {
|
||||
show_sessions: true,
|
||||
show_panel: true,
|
||||
panel: PanelTab::Git,
|
||||
sessions_width: 240.0,
|
||||
panel_width: 240.0,
|
||||
window_width: 1200.0,
|
||||
window_height: 760.0,
|
||||
}
|
||||
@@ -114,6 +119,7 @@ pub const LINE_HEIGHT: RangeInclusive<f32> = 1.0..=2.0;
|
||||
pub const OPACITY: RangeInclusive<f32> = 0.3..=1.0;
|
||||
pub const PADDING: RangeInclusive<f32> = 0.0..=64.0;
|
||||
pub const SCROLLBACK: RangeInclusive<u32> = 0..=100_000;
|
||||
pub const COLUMN: RangeInclusive<f32> = 160.0..=960.0;
|
||||
pub const WINDOW: RangeInclusive<f32> = 100.0..=16384.0;
|
||||
|
||||
impl Settings {
|
||||
@@ -125,6 +131,8 @@ impl Settings {
|
||||
within("padding_x", self.padding_x, &PADDING)?;
|
||||
within("padding_y", self.padding_y, &PADDING)?;
|
||||
within("scrollback", self.scrollback, &SCROLLBACK)?;
|
||||
within("sessions_width", self.sessions_width, &COLUMN)?;
|
||||
within("panel_width", self.panel_width, &COLUMN)?;
|
||||
within("window_width", self.window_width, &WINDOW)?;
|
||||
within("window_height", self.window_height, &WINDOW)?;
|
||||
for (field, id) in [
|
||||
@@ -242,6 +250,12 @@ mod tests {
|
||||
error.to_string(),
|
||||
"window_width is 50, outside 100 to 16384"
|
||||
);
|
||||
let settings = Settings {
|
||||
panel_width: 1000.0,
|
||||
..Settings::default()
|
||||
};
|
||||
let error = settings.validate().expect_err("too wide");
|
||||
assert_eq!(error.to_string(), "panel_width is 1000, outside 160 to 960");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user