diff --git a/src/lib.rs b/src/lib.rs index 7bee4ba..2be116b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1088,6 +1088,24 @@ impl<'ui> Ui<'ui> { } } +impl<'ui> Ui<'ui> { + /// Runs a function after temporarily pushing an array of values to the + /// style and color stack. + pub fn with_style_and_color_vars( + &self, + style_vars: &[StyleVar], + color_vars: &[(ImGuiCol, C)], + f: F, + ) where + F: FnOnce(), + C: Into + Copy, + { + self.with_style_vars(style_vars, || { + self.with_color_vars(color_vars, f); + }); + } +} + /// # Utilities impl<'ui> Ui<'ui> { /// Returns `true` if the last item is being hovered by the mouse.