Pass WindowContext
to ViewHandle::is_focused
This commit is contained in:
parent
74ca223114
commit
98dce89379
3 changed files with 8 additions and 9 deletions
|
@ -3928,12 +3928,8 @@ impl<T: View> ViewHandle<T> {
|
|||
});
|
||||
}
|
||||
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
pub fn is_focused(&self, cx: &AppContext) -> bool {
|
||||
cx.read_window(self.window_id, |cx| {
|
||||
cx.focused_view_id() == Some(self.view_id)
|
||||
})
|
||||
.unwrap_or(false)
|
||||
pub fn is_focused(&self, cx: &WindowContext) -> bool {
|
||||
cx.focused_view_id() == Some(self.view_id)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue