Skip to main content

Slider

Struct Slider 

Source
pub struct Slider { /* private fields */ }
Expand description

Slider widget

Implementations§

Source§

impl Slider

Source

pub fn new() -> Self

Create a new slider

Source

pub fn value(self, value: f64) -> Self

Set value

Source

pub fn range(self, min: f64, max: f64) -> Self

Set range

Source

pub fn step(self, step: f64) -> Self

Set step size

Source

pub fn orientation(self, orientation: SliderOrientation) -> Self

Set orientation

Source

pub fn horizontal(self) -> Self

Make horizontal

Source

pub fn vertical(self) -> Self

Make vertical

Source

pub fn style(self, style: SliderStyle) -> Self

Set style

Source

pub fn length(self, length: u16) -> Self

Set length

Source

pub fn show_value(self, show: bool) -> Self

Show/hide value

Source

pub fn value_format(self, format: impl Into<String>) -> Self

Set value format

Source

pub fn track_color(self, color: Color) -> Self

Set track color

Source

pub fn fill_color(self, color: Color) -> Self

Set fill color

Source

pub fn knob_color(self, color: Color) -> Self

Set knob color

Source

pub fn focused(self, focused: bool) -> Self

Set focused state

Source

pub fn disabled(self, disabled: bool) -> Self

Set disabled state

Source

pub fn label(self, label: impl Into<String>) -> Self

Set label

Source

pub fn ticks(self, count: u16) -> Self

Show tick marks

Source

pub fn set_value(&mut self, value: f64)

Set value

Source

pub fn get_value(&self) -> f64

Get current value

Source

pub fn increment(&mut self)

Increment value

Source

pub fn decrement(&mut self)

Decrement value

Source

pub fn set_min(&mut self)

Set to minimum

Source

pub fn set_max(&mut self)

Set to maximum

Source

pub fn handle_key(&mut self, key: &Key) -> bool

Handle key input

Source§

impl Slider

Source

pub fn element_id(self, id: impl Into<String>) -> Self

Set element ID for CSS selector (#id)

Source

pub fn class(self, class: impl Into<String>) -> Self

Add a CSS class

Source

pub fn classes<I, S>(self, classes: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Add multiple CSS classes

Trait Implementations§

Source§

impl Default for Slider

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl StyledView for Slider

Source§

fn set_id(&mut self, id: impl Into<String>)

Set element ID
Source§

fn add_class(&mut self, class: impl Into<String>)

Add a CSS class
Source§

fn remove_class(&mut self, class: &str)

Remove a CSS class
Source§

fn toggle_class(&mut self, class: &str)

Toggle a CSS class
Source§

fn has_class(&self, class: &str) -> bool

Check if has class
Source§

impl View for Slider

Source§

fn id(&self) -> Option<&str>

Get element ID (for CSS #id selectors) Read more
Source§

fn classes(&self) -> &[String]

Get CSS classes (for CSS .class selectors) Read more
Source§

fn meta(&self) -> WidgetMeta

Get widget metadata for DOM Read more
Source§

fn render(&self, ctx: &mut RenderContext<'_>)

Render the view to the given context Read more
Source§

fn widget_type(&self) -> &'static str

Get widget type name (for CSS type selectors) Read more
Source§

fn children(&self) -> &[Box<dyn View>]

Get child views (for container widgets) Read more

Auto Trait Implementations§

§

impl Freeze for Slider

§

impl RefUnwindSafe for Slider

§

impl Send for Slider

§

impl Sync for Slider

§

impl Unpin for Slider

§

impl UnwindSafe for Slider

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.