mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-20 01:48:29 +00:00
[ImGui] Wrap igIsWindowFocused
Wrap with three different functions, one for each of the possible values of ImGuiFocusedFlags given as argument to igIsWindowFocused.
This commit is contained in:
parent
4f080de586
commit
3b26f6bde9
21
src/lib.rs
21
src/lib.rs
@ -33,9 +33,9 @@ pub use sliders::{
|
||||
pub use string::{ImStr, ImString};
|
||||
pub use style::StyleVar;
|
||||
pub use sys::{
|
||||
ImDrawIdx, ImDrawVert, ImGuiCol, ImGuiColorEditFlags, ImGuiCond, ImGuiHoveredFlags,
|
||||
ImGuiInputTextFlags, ImGuiKey, ImGuiMouseCursor, ImGuiSelectableFlags, ImGuiStyle,
|
||||
ImGuiTreeNodeFlags, ImGuiWindowFlags, ImVec2, ImVec4,
|
||||
ImDrawIdx, ImDrawVert, ImGuiCol, ImGuiColorEditFlags, ImGuiCond, ImGuiFocusedFlags,
|
||||
ImGuiHoveredFlags, ImGuiInputTextFlags, ImGuiKey, ImGuiMouseCursor, ImGuiSelectableFlags,
|
||||
ImGuiStyle, ImGuiTreeNodeFlags, ImGuiWindowFlags, ImVec2, ImVec4,
|
||||
};
|
||||
pub use trees::{CollapsingHeader, TreeNode};
|
||||
pub use window::Window;
|
||||
@ -1558,6 +1558,21 @@ impl<'ui> Ui<'ui> {
|
||||
unsafe { sys::igIsWindowHovered(ImGuiHoveredFlags::empty()) }
|
||||
}
|
||||
|
||||
/// Return `true` if the current window is currently focused.
|
||||
pub fn is_window_focused(&self) -> bool {
|
||||
unsafe { sys::igIsWindowFocused(ImGuiFocusedFlags::RootAndChildWindows) }
|
||||
}
|
||||
|
||||
/// Return `true` if the current root window is currently focused.
|
||||
pub fn is_root_window_focused(&self) -> bool {
|
||||
unsafe { sys::igIsWindowFocused(ImGuiFocusedFlags::RootWindow) }
|
||||
}
|
||||
|
||||
/// Return `true` if the current child window is currently focused.
|
||||
pub fn is_child_window_focused(&self) -> bool {
|
||||
unsafe { sys::igIsWindowFocused(ImGuiFocusedFlags::ChildWindows) }
|
||||
}
|
||||
|
||||
/// Returns `true` if the last item is being active.
|
||||
pub fn is_item_active(&self) -> bool {
|
||||
unsafe { sys::igIsItemActive() }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user