Skip to content

Commit

Permalink
Deduplicate ui.enabled(...) and ui.disabled()
Browse files Browse the repository at this point in the history
  • Loading branch information
dbr committed Apr 23, 2022
1 parent 5ec80ec commit 69f43e3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions imgui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,9 +723,7 @@ impl Ui {
/// [`Ui::begin_enabled`].
#[doc(alias = "BeginDisabled", alias = "EndDisabled")]
pub fn enabled<F: FnOnce()>(&self, enabled: bool, f: F) {
unsafe { sys::igBeginDisabled(!enabled) };
f();
unsafe { sys::igEndDisabled() };
self.disabled(!enabled, f)
}
}

Expand Down

0 comments on commit 69f43e3

Please sign in to comment.