Better mouse controls
This commit is contained in:
parent
b0ff49cbb6
commit
e5916526cb
1 changed files with 4 additions and 1 deletions
|
|
@ -86,9 +86,12 @@ impl Element for Panes {
|
||||||
self.selected = new_idx;
|
self.selected = new_idx;
|
||||||
Ok(Resp::handled(None))
|
Ok(Resp::handled(None))
|
||||||
}
|
}
|
||||||
Some(Action::Mouse(_, pos, _)) => {
|
Some(Action::Mouse(action, pos, _)) => {
|
||||||
for (i, pane) in self.panes.iter_mut().enumerate() {
|
for (i, pane) in self.panes.iter_mut().enumerate() {
|
||||||
if pane.last_area.contains(pos).is_some() {
|
if pane.last_area.contains(pos).is_some() {
|
||||||
|
if matches!(action, MouseAction::Click) {
|
||||||
|
self.selected = i;
|
||||||
|
}
|
||||||
match &mut pane.kind {
|
match &mut pane.kind {
|
||||||
PaneKind::Doc(doc) => return doc.handle(state, event),
|
PaneKind::Doc(doc) => return doc.handle(state, event),
|
||||||
PaneKind::Empty => {}
|
PaneKind::Empty => {}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue