Allow context menu to be cancelled after deploying it twice
Previously, two right clicks would cause an issue with cancelling the context menu via escape.
This commit is contained in:
parent
c3baf2748f
commit
9909fc529b
2 changed files with 7 additions and 1 deletions
|
@ -3255,6 +3255,10 @@ impl<'a, T: View> ViewContext<'a, T> {
|
|||
self.app.focus(self.window_id, Some(self.view_id));
|
||||
}
|
||||
|
||||
pub fn is_self_focused(&self) -> bool {
|
||||
self.app.focused_view_id(self.window_id) == Some(self.view_id)
|
||||
}
|
||||
|
||||
pub fn blur(&mut self) {
|
||||
self.app.focus(self.window_id, None);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue