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 moreSource§impl<'ui, T: Debug> Debug for ColorButton<'ui, T>
impl<'ui, T: Debug> Debug for ColorButton<'ui, T>
impl<'ui, T: Copy> Copy for ColorButton<'ui, T>
Auto Trait Implementations§
impl<'ui, T> Freeze for ColorButton<'ui, T>where
T: Freeze,
impl<'ui, T> !RefUnwindSafe for ColorButton<'ui, T>
impl<'ui, T> !Send for ColorButton<'ui, T>
impl<'ui, T> !Sync for ColorButton<'ui, T>
impl<'ui, T> Unpin for ColorButton<'ui, T>where
T: Unpin,
impl<'ui, T> !UnwindSafe for ColorButton<'ui, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more