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> ColorButton<'ui, T>
impl<'ui, T> ColorButton<'ui, T>
Sourcepub fn new(
ui: &'ui Ui,
desc_id: T,
color: impl Into<Vector4<f32>>,
) -> ColorButton<'ui, T>
👎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>>, ) -> ColorButton<'ui, T>
ui.color_button_config(...)
insteadConstructs a new color button builder.
Sourcepub fn flags(self, flags: ColorEditFlags) -> ColorButton<'ui, T>
pub fn flags(self, flags: ColorEditFlags) -> ColorButton<'ui, T>
Replaces all current settings with the given flags.
Sourcepub fn alpha(self, value: bool) -> ColorButton<'ui, T>
pub fn alpha(self, value: bool) -> ColorButton<'ui, T>
Enables/disables the use of the alpha component.
Sourcepub fn tooltip(self, value: bool) -> ColorButton<'ui, T>
pub fn tooltip(self, value: bool) -> ColorButton<'ui, T>
Enables/disables the tooltip that appears when hovering the preview.
Sourcepub fn preview(self, preview: ColorPreview) -> ColorButton<'ui, T>
pub fn preview(self, preview: ColorPreview) -> ColorButton<'ui, T>
Sets the preview style.
Sourcepub fn input_mode(self, input_mode: ColorEditInputMode) -> ColorButton<'ui, T>
pub fn input_mode(self, input_mode: ColorEditInputMode) -> ColorButton<'ui, T>
Sets the data format for input data.
Sourcepub fn drag_drop(self, value: bool) -> ColorButton<'ui, T>
pub fn drag_drop(self, value: bool) -> ColorButton<'ui, T>
Enables/disables using the button as drag&drop source.
Enabled by default.
Sourcepub fn border(self, value: bool) -> ColorButton<'ui, T>
pub fn border(self, value: bool) -> ColorButton<'ui, T>
Enables/disables the button border.
Enabled by default.
Trait Implementations§
Source§impl<'ui, T> Clone for ColorButton<'ui, T>where
T: Clone,
impl<'ui, T> Clone for ColorButton<'ui, T>where
T: Clone,
Source§fn clone(&self) -> ColorButton<'ui, T>
fn clone(&self) -> ColorButton<'ui, T>
Returns a duplicate 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 for ColorButton<'ui, T>where
T: Debug,
impl<'ui, T> Debug for ColorButton<'ui, T>where
T: Debug,
impl<'ui, T> Copy for ColorButton<'ui, T>where
T: Copy,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more