From 8fa58fb52c3e1d514d0badf424757b187d2e57b8 Mon Sep 17 00:00:00 2001 From: Joonas Javanainen Date: Fri, 5 Jun 2020 22:03:22 +0300 Subject: [PATCH] Apply some missing 1.76 changes --- src/io.rs | 4 ++-- src/widget/color_editors.rs | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/io.rs b/src/io.rs index d61afe0..1ba90cb 100644 --- a/src/io.rs +++ b/src/io.rs @@ -265,9 +265,9 @@ pub struct Io { /// /// *Important*: You need to clear this flag yourself pub want_save_ini_settings: bool, - /// Directional navigation is currently allowed + /// Keyboard/Gamepad navigation is currently allowed pub nav_active: bool, - /// Directional navigation is visible and allowed + /// Keyboard/Gamepad navigation is visible and allowed pub nav_visible: bool, /// Application framerate estimation, in frames per second. /// diff --git a/src/widget/color_editors.rs b/src/widget/color_editors.rs index 24b03af..fb99ce1 100644 --- a/src/widget/color_editors.rs +++ b/src/widget/color_editors.rs @@ -112,6 +112,8 @@ bitflags! { const NO_SIDE_PREVIEW = sys::ImGuiColorEditFlags_NoSidePreview; /// ColorEdit: disable drag and drop target. ColorButton: disable drag and drop source. const NO_DRAG_DROP = sys::ImGuiColorEditFlags_NoDragDrop; + /// ColorButton: disable border (which is enforced by default). + const NO_BORDER = sys::ImGuiColorEditFlags_NoBorder; /// ColorEdit, ColorPicker: show vertical alpha bar/gradient in picker. const ALPHA_BAR = sys::ImGuiColorEditFlags_AlphaBar; @@ -574,10 +576,19 @@ impl<'a> ColorButton<'a> { self } /// Enables/disables using the button as drag&drop source. + /// + /// Enabled by default. pub fn drag_drop(mut self, value: bool) -> Self { self.flags.set(ColorEditFlags::NO_DRAG_DROP, !value); self } + /// Enables/disables the button border. + /// + /// Enabled by default. + pub fn border(mut self, value: bool) -> Self { + self.flags.set(ColorEditFlags::NO_BORDER, !value); + self + } /// Sets the button size. /// /// Use 0.0 for width and/or height to use the default size.