[][src]Struct imgui::ColorButton

#[must_use]pub struct ColorButton<'a> { /* fields omitted */ }

Builder for a color button widget.

Examples

ColorButton::new(im_str!("color_button"), [1.0, 0.0, 0.0, 1.0])
    .build(&ui);

Implementations

impl<'a> ColorButton<'a>[src]

pub fn new(desc_id: &ImStr, color: [f32; 4]) -> ColorButton<'_>[src]

Constructs a new color button builder.

pub fn flags(self, flags: ColorEditFlags) -> Self[src]

Replaces all current settings with the given flags.

pub fn alpha(self, value: bool) -> Self[src]

Enables/disables the use of the alpha component.

pub fn tooltip(self, value: bool) -> Self[src]

Enables/disables the tooltip that appears when hovering the preview.

pub fn preview(self, preview: ColorPreview) -> Self[src]

Sets the preview style.

pub fn input_mode(self, input_mode: ColorEditInputMode) -> Self[src]

Sets the data format for input data.

pub fn drag_drop(self, value: bool) -> Self[src]

Enables/disables using the button as drag&drop source.

Enabled by default.

pub fn border(self, value: bool) -> Self[src]

Enables/disables the button border.

Enabled by default.

pub fn size(self, size: [f32; 2]) -> Self[src]

Sets the button size.

Use 0.0 for width and/or height to use the default size.

pub fn build(self, _: &Ui<'_>) -> bool[src]

Builds the color button.

Returns true if this color button was clicked.

Trait Implementations

impl<'a> Clone for ColorButton<'a>[src]

impl<'a> Copy for ColorButton<'a>[src]

impl<'a> Debug for ColorButton<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for ColorButton<'a>[src]

impl<'a> Send for ColorButton<'a>[src]

impl<'a> Sync for ColorButton<'a>[src]

impl<'a> Unpin for ColorButton<'a>[src]

impl<'a> UnwindSafe for ColorButton<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.