Avoid publishing on all mouse events
This commit is contained in:
parent
27e4d722bf
commit
b308110f22
1 changed files with 10 additions and 9 deletions
|
|
@ -1100,10 +1100,12 @@ where
|
||||||
}
|
}
|
||||||
// Update context menu state
|
// Update context menu state
|
||||||
if let Some(on_context_menu) = &self.on_context_menu {
|
if let Some(on_context_menu) = &self.on_context_menu {
|
||||||
shell.publish((on_context_menu)(match self.context_menu {
|
match self.context_menu {
|
||||||
Some(_) => None,
|
Some(_) => {
|
||||||
None => match button {
|
shell.publish(on_context_menu(None));
|
||||||
Button::Right => {
|
}
|
||||||
|
None => {
|
||||||
|
if button == Button::Right {
|
||||||
let x = p.x - self.padding.left;
|
let x = p.x - self.padding.left;
|
||||||
let y = p.y - self.padding.top;
|
let y = p.y - self.padding.top;
|
||||||
//TODO: better calculation of position
|
//TODO: better calculation of position
|
||||||
|
|
@ -1120,14 +1122,13 @@ where
|
||||||
None,
|
None,
|
||||||
);
|
);
|
||||||
let link = get_hyperlink(&terminal, location);
|
let link = get_hyperlink(&terminal, location);
|
||||||
Some(MenuState {
|
shell.publish(on_context_menu(Some(MenuState {
|
||||||
position: Some(p),
|
position: Some(p),
|
||||||
link,
|
link,
|
||||||
})
|
})));
|
||||||
}
|
}
|
||||||
_ => None,
|
}
|
||||||
},
|
}
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
status = Status::Captured;
|
status = Status::Captured;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue