From aee654578408c7fbdb1640d2dca8eaea4ec1754e Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Mon, 30 Mar 2026 01:05:55 +0300 Subject: feat: add manual sidebar resizing --- src/app/state.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/app/state.rs') 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, } -/// Active mouse drag on a split border. +pub(crate) enum DragTarget { + PaneSplit { + path: Vec, + direction: Direction, + area: Rect, + }, + SidebarDivider, +} + +/// Active mouse drag on a split border or sidebar divider. pub(crate) struct DragState { - pub path: Vec, - 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, -- cgit v1.2.3