mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-24 06:01:55 +00:00
feat: mouse hori scrolls
This commit is contained in:
parent
a6e948f1c9
commit
654cd615cf
|
@ -268,6 +268,8 @@ impl FloatContent for FloatingText {
|
||||||
match event.kind {
|
match event.kind {
|
||||||
MouseEventKind::ScrollDown => self.scroll_down(),
|
MouseEventKind::ScrollDown => self.scroll_down(),
|
||||||
MouseEventKind::ScrollUp => self.scroll_up(),
|
MouseEventKind::ScrollUp => self.scroll_up(),
|
||||||
|
MouseEventKind::ScrollLeft => self.scroll_left(),
|
||||||
|
MouseEventKind::ScrollRight => self.scroll_right(),
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
|
|
@ -424,18 +424,24 @@ impl AppState {
|
||||||
match &mut self.focus {
|
match &mut self.focus {
|
||||||
Focus::TabList => match event.kind {
|
Focus::TabList => match event.kind {
|
||||||
MouseEventKind::ScrollDown => {
|
MouseEventKind::ScrollDown => {
|
||||||
|
if self.current_tab.selected().unwrap() != self.tabs.len() - 1 {
|
||||||
self.current_tab.select_next();
|
self.current_tab.select_next();
|
||||||
|
}
|
||||||
self.refresh_tab();
|
self.refresh_tab();
|
||||||
}
|
}
|
||||||
MouseEventKind::ScrollUp => {
|
MouseEventKind::ScrollUp => {
|
||||||
self.current_tab.select_next();
|
if self.current_tab.selected().unwrap() != 0 {
|
||||||
|
self.current_tab.select_previous();
|
||||||
|
}
|
||||||
self.refresh_tab();
|
self.refresh_tab();
|
||||||
}
|
}
|
||||||
|
MouseEventKind::ScrollRight => self.focus = Focus::List,
|
||||||
_ => {}
|
_ => {}
|
||||||
},
|
},
|
||||||
Focus::List => match event.kind {
|
Focus::List => match event.kind {
|
||||||
MouseEventKind::ScrollDown => self.selection.select_next(),
|
MouseEventKind::ScrollDown => self.selection.select_next(),
|
||||||
MouseEventKind::ScrollUp => self.selection.select_previous(),
|
MouseEventKind::ScrollUp => self.selection.select_previous(),
|
||||||
|
MouseEventKind::ScrollLeft => self.focus = Focus::TabList,
|
||||||
_ => {}
|
_ => {}
|
||||||
},
|
},
|
||||||
Focus::FloatingWindow(float) => {
|
Focus::FloatingWindow(float) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user