Struct imgui::ColorButton
source · pub struct ColorButton<'ui, T> { /* private fields */ }
Expand description
Builder for a color button widget.
Examples
if ui.color_button("color_button", [1.0, 0.0, 0.0, 1.0]) {
println!("pressed!");
}
Implementations§
source§impl<'ui, T: AsRef<str>> ColorButton<'ui, T>
impl<'ui, T: AsRef<str>> ColorButton<'ui, T>
sourcepub fn new(ui: &'ui Ui, desc_id: T, color: impl Into<Vector4<f32>>) -> Self
👎Deprecated since 0.9.0: Use ui.color_button_config(...)
instead
pub fn new(ui: &'ui Ui, desc_id: T, color: impl Into<Vector4<f32>>) -> Self
ui.color_button_config(...)
insteadConstructs a new color button builder.
sourcepub fn flags(self, flags: ColorEditFlags) -> Self
pub fn flags(self, flags: ColorEditFlags) -> Self
Replaces all current settings with the given flags.
sourcepub fn tooltip(self, value: bool) -> Self
pub fn tooltip(self, value: bool) -> Self
Enables/disables the tooltip that appears when hovering the preview.
sourcepub fn preview(self, preview: ColorPreview) -> Self
pub fn preview(self, preview: ColorPreview) -> Self
Sets the preview style.
sourcepub fn input_mode(self, input_mode: ColorEditInputMode) -> Self
pub fn input_mode(self, input_mode: ColorEditInputMode) -> Self
Sets the data format for input data.
sourcepub fn drag_drop(self, value: bool) -> Self
pub fn drag_drop(self, value: bool) -> Self
Enables/disables using the button as drag&drop source.
Enabled by default.
sourcepub fn border(self, value: bool) -> Self
pub fn border(self, value: bool) -> Self
Enables/disables the button border.
Enabled by default.
Trait Implementations§
source§impl<'ui, T: Clone> Clone for ColorButton<'ui, T>
impl<'ui, T: Clone> Clone for ColorButton<'ui, T>
source§fn clone(&self) -> ColorButton<'ui, T>
fn clone(&self) -> ColorButton<'ui, T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more