From 1082a29a379f3a7a72b57d17ee5f549398b53425 Mon Sep 17 00:00:00 2001 From: Jack Mac Date: Sat, 25 Sep 2021 12:57:52 -0400 Subject: [PATCH] removed push style color multiple, which was silly --- CHANGELOG.markdown | 2 ++ imgui/src/stacks.rs | 36 +----------------------------------- 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index 2250024..8f2fd50 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -4,6 +4,8 @@ - MSRV is now **1.54**. We soft-updated to this in 0.8.0 with a feature `min-const-generics`, which has now been removed (and as such, we resume having no default features). +- BREAKING: Removed `push_style_colors`. Instead, use `push_style_color` in a loop. This was deprecated in `0.7.0` and should have been removed in `0.8.0`. + ## [0.8.0] - 2021-09-17 Welcome to the `0.8.0` update. This is one of the largest updates imgui-rs has ever seen; it will generate errors in a `0.7` project, but hopefully it should be both quick to fix, and enjoyable to update. See our [release page](https://github.com/imgui-rs/imgui-rs/releases/tag/v0.8.0) for more information and a list of contributors to this cycle. Thank you to everyone who uses `imgui-rs`, files issues, and spend their time and effort to PR new changes into the codebase. Because of all that effort, this is by far the best `imgui-rs` has looked! diff --git a/imgui/src/stacks.rs b/imgui/src/stacks.rs index b507741..65c1c1a 100644 --- a/imgui/src/stacks.rs +++ b/imgui/src/stacks.rs @@ -68,41 +68,7 @@ impl<'ui> Ui<'ui> { ColorStackToken::new(self) } - /// Changes style colors by pushing several changes to the color stack. - /// - /// Returns a `ColorStackToken` that must be popped by calling `.pop()` - /// - /// # Examples - /// - /// ```no_run - /// # use imgui::*; - /// # let mut ctx = Context::create(); - /// # let ui = ctx.frame(); - /// const RED: [f32; 4] = [1.0, 0.0, 0.0, 1.0]; - /// const GREEN: [f32; 4] = [0.0, 1.0, 0.0, 1.0]; - /// let colors = ui.push_style_colors(&[ - /// (StyleColor::Text, RED), - /// (StyleColor::TextDisabled, GREEN), - /// ]); - /// ui.text("I'm red!"); - /// ui.text_disabled("I'm green!"); - /// colors.pop(&ui); - /// ``` - #[deprecated = "deprecated in 0.7.0. Use `push_style_color` multiple times for similar effect."] - pub fn push_style_colors<'a, I>(&self, style_colors: I) -> MultiColorStackToken - where - I: IntoIterator, - { - let mut count = 0; - for &(style_color, color) in style_colors { - unsafe { sys::igPushStyleColor_Vec4(style_color as i32, color.into()) }; - count += 1; - } - MultiColorStackToken { - count, - ctx: self.ctx, - } - } + /// Changes a style variable by pushing a change to the style stack. /// /// Returns a `StyleStackToken` that can be popped by calling `.end()`