update imgui helpers, split mouse_over_any into two separate functions
since it was kind of doing both, but the name implied otherwise, and hence was incorrect behaviour
This commit is contained in:
parent
b9ae66ea44
commit
1d64384088
|
@ -50,12 +50,16 @@ impl SystemEventHandler for ImGui {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait UiSupport {
|
pub trait UiSupport {
|
||||||
fn is_mouse_over_any(&self) -> bool;
|
fn is_any_hovered(&self) -> bool;
|
||||||
|
fn is_any_focused(&self) -> bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl UiSupport for imgui::Ui {
|
impl UiSupport for imgui::Ui {
|
||||||
fn is_mouse_over_any(&self) -> bool {
|
fn is_any_hovered(&self) -> bool {
|
||||||
|
self.is_window_hovered_with_flags(imgui::WindowHoveredFlags::ANY_WINDOW)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn is_any_focused(&self) -> bool {
|
||||||
self.is_window_focused_with_flags(imgui::WindowFocusedFlags::ANY_WINDOW)
|
self.is_window_focused_with_flags(imgui::WindowFocusedFlags::ANY_WINDOW)
|
||||||
|| self.is_window_hovered_with_flags(imgui::WindowHoveredFlags::ANY_WINDOW)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue