From 6292c5cd4ef054180bb4d4d377cdb0f51f6ff9fe Mon Sep 17 00:00:00 2001 From: nnyyxxxx Date: Wed, 13 Nov 2024 00:05:15 -0500 Subject: [PATCH] bring up description on scroll wheel pressdown, bring up script preview on Right Mouse Button pressdown --- tui/src/state.rs | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/tui/src/state.rs b/tui/src/state.rs index 36e33b8f..2da2eb69 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -548,21 +548,36 @@ impl AppState { } } } - MouseEventKind::Down(MouseButton::Left) => { - if mouse_in_search { - self.enter_search(); - } else if mouse_in_list { - if matches!(self.focus, Focus::Search) { - self.exit_search(); + MouseEventKind::Down(button) => match button { + MouseButton::Left => { + if mouse_in_search { + self.enter_search(); + } else if mouse_in_list { + if matches!(self.focus, Focus::Search) { + self.exit_search(); + } + self.handle_enter(); + } else if mouse_in_tab_list { + if matches!(self.focus, Focus::Search) { + self.exit_search(); + } + self.focus = Focus::List; } - self.handle_enter(); - } else if mouse_in_tab_list { - if matches!(self.focus, Focus::Search) { - self.exit_search(); - } - self.focus = Focus::List; } - } + MouseButton::Right if mouse_in_list => { + if matches!(self.focus, Focus::Search) { + self.exit_search(); + } + self.enable_preview(); + } + MouseButton::Middle if mouse_in_list => { + if matches!(self.focus, Focus::Search) { + self.exit_search(); + } + self.enable_description(); + } + _ => {} + }, MouseEventKind::ScrollDown | MouseEventKind::ScrollUp => { if matches!(self.focus, Focus::Search) { self.exit_search();