From c58a93bfc13edda2f82d05efd3562ab8d6b23147 Mon Sep 17 00:00:00 2001 From: Malik Olivier Boussejra Date: Fri, 30 Mar 2018 09:53:27 +0900 Subject: [PATCH] ui: Wrap invisible_button --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 73a675f..5b0f224 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -610,6 +610,11 @@ impl<'ui> Ui<'ui> { pub fn small_button<'p>(&self, label: &'p ImStr) -> bool { unsafe { sys::igSmallButton(label.as_ptr()) } } + /// Make a invisible event. Can be used to conveniently catch events when + /// mouse hovers or click the area covered by this invisible button. + pub fn invisible_button<'p, S: Into>(&self, label: &'p ImStr, size: S) -> bool { + unsafe { sys::igInvisibleButton(label.as_ptr(), size.into()) } + } pub fn checkbox<'p>(&self, label: &'p ImStr, value: &'p mut bool) -> bool { unsafe { sys::igCheckbox(label.as_ptr(), value) } }