Apply some missing 1.76 changes

This commit is contained in:
Joonas Javanainen 2020-06-05 22:03:22 +03:00
parent 89712e1f3d
commit 8fa58fb52c
No known key found for this signature in database
GPG Key ID: D39CCA5CB19B9179
2 changed files with 13 additions and 2 deletions

View File

@ -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.
///

View File

@ -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.