Skip to content

Commit

Permalink
bring up description on scroll wheel pressdown, bring up script previ…
Browse files Browse the repository at this point in the history
…ew on Right Mouse Button pressdown
  • Loading branch information
nnyyxxxx committed Nov 13, 2024
1 parent 9bd8938 commit 6292c5c
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions tui/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,21 +548,36 @@ impl AppState {
}
}
}
MouseEventKind::Down(MouseButton::Left) => {
if mouse_in_search {
self.enter_search();
} else if mouse_in_list {
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;
}
}
MouseButton::Right if mouse_in_list => {
if matches!(self.focus, Focus::Search) {
self.exit_search();
}
self.handle_enter();
} else if mouse_in_tab_list {
self.enable_preview();
}
MouseButton::Middle if mouse_in_list => {
if matches!(self.focus, Focus::Search) {
self.exit_search();
}
self.focus = Focus::List;
self.enable_description();
}
}
_ => {}
},
MouseEventKind::ScrollDown | MouseEventKind::ScrollUp => {
if matches!(self.focus, Focus::Search) {
self.exit_search();
Expand Down

0 comments on commit 6292c5c

Please sign in to comment.