mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-14 23:18:28 +00:00
Merge pull request #156 from malikolivier/patch-wrap-is-window-focus
[ImGui] Wrap igIsWindowFocused
This commit is contained in:
commit
c2f3936879
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