diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-03-30 01:05:55 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-03-30 01:05:55 +0300 |
| commit | aee654578408c7fbdb1640d2dca8eaea4ec1754e (patch) | |
| tree | 908ba777c917a6f1c06e9c9ebd4409e1a440b95e /src/app/state.rs | |
| parent | 263b8f32654588bc0ca229361f7b7be30d72aed2 (diff) | |
feat: add manual sidebar resizing
Diffstat (limited to 'src/app/state.rs')
| -rw-r--r-- | src/app/state.rs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/app/state.rs b/src/app/state.rs index fcde6bff..b1350e48 100644 --- a/src/app/state.rs +++ b/src/app/state.rs @@ -389,11 +389,18 @@ pub struct SettingsState { pub original_theme: Option<String>, } -/// Active mouse drag on a split border. +pub(crate) enum DragTarget { + PaneSplit { + path: Vec<bool>, + direction: Direction, + area: Rect, + }, + SidebarDivider, +} + +/// Active mouse drag on a split border or sidebar divider. pub(crate) struct DragState { - pub path: Vec<bool>, - pub direction: Direction, - pub area: Rect, + pub target: DragTarget, } #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -464,6 +471,7 @@ pub struct AppState { pub prefix_code: KeyCode, pub prefix_mods: KeyModifiers, pub sidebar_width: u16, + pub sidebar_width_auto: bool, pub sidebar_collapsed: bool, pub confirm_close: bool, pub confirm_close_selected_confirm: bool, @@ -554,6 +562,7 @@ impl AppState { prefix_code: KeyCode::Char('b'), prefix_mods: KeyModifiers::CONTROL, sidebar_width: 26, + sidebar_width_auto: true, sidebar_collapsed: false, confirm_close: true, confirm_close_selected_confirm: true, |
