From cbe8df817431443492f037fac377e76748f9573b Mon Sep 17 00:00:00 2001 From: Cameron Hart Date: Fri, 30 Dec 2016 16:28:35 +1100 Subject: [PATCH 1/3] Exposed close_current_popup function. --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 2863c11..3df08e8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -616,6 +616,9 @@ impl<'ui> Ui<'ui> { unsafe { imgui_sys::igEndPopup() }; } } + pub fn close_current_popup(&self) { + unsafe { imgui_sys::igCloseCurrentPopup() }; + } } // Widgets: Combos From bb0d712cac69b5baefceb11a8cfaf0e44045189d Mon Sep 17 00:00:00 2001 From: Cameron Hart Date: Fri, 30 Dec 2016 16:29:12 +1100 Subject: [PATCH 2/3] Exposed button function. Size must be specified versus using the builder pattern. --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 3df08e8..c38281e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -478,6 +478,9 @@ impl<'ui> Ui<'ui> { imgui_sys::igBulletText(fmt_ptr(), text.as_ptr()); } } + pub fn button<'p>(&self, label: ImStr<'p>, size: ImVec2) -> bool { + unsafe { imgui_sys::igButton(label.as_ptr(), size) } + } pub fn small_button<'p>(&self, label: ImStr<'p>) -> bool { unsafe { imgui_sys::igSmallButton(label.as_ptr()) } } From 0254b7cbe795d9069e4f05bb9840319a6d99aef9 Mon Sep 17 00:00:00 2001 From: Cameron Hart Date: Fri, 30 Dec 2016 16:29:47 +1100 Subject: [PATCH 3/3] Added ImVec2::zero() for convenience. --- imgui-sys/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/imgui-sys/src/lib.rs b/imgui-sys/src/lib.rs index fe87031..108b4e8 100644 --- a/imgui-sys/src/lib.rs +++ b/imgui-sys/src/lib.rs @@ -321,6 +321,12 @@ impl ImVec2 { y: y as c_float, } } + pub fn zero() -> ImVec2 { + ImVec2 { + x: 0.0 as c_float, + y: 0.0 as c_float, + } + } } impl From<[f32; 2]> for ImVec2 {