Bar

Struct Bar 

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

Horizontal or vertical bar component

Implementations§

Source§

impl Bar

Source

pub fn new<V>(value: V) -> Self
where V: Into<f32>,

Create a new bar

Source

pub fn range(self, range: RangeInclusive<f32>) -> Self

Set the range of the bar

Source

pub fn vertical(self, max_width: f32) -> Self

Set the bar vertical

Source

pub fn text(self, text: impl Display) -> Self

Set the bar text

Source

pub fn font_size(self, font_size: f32) -> Self

Set the bar text font size

Source

pub fn label_size(self, font_size: f32) -> Self

Set the bar labels font size

Source

pub fn bar_size(self, size: f32) -> Self

Sets the bar size (width for horizontal, height for vertical)

Source

pub fn fg_color(self, color: Color32) -> Self

Sets the bar foreground color

Source

pub fn ticks(self, n: usize) -> Self

Set the number of the ticks, number below 2 disables the ticks

Trait Implementations§

Source§

impl Widget for Bar

Source§

fn ui(self, ui: &mut Ui) -> Response

Allocate space, interact, paint, and return a Response. Read more

Auto Trait Implementations§

§

impl Freeze for Bar

§

impl RefUnwindSafe for Bar

§

impl Send for Bar

§

impl Sync for Bar

§

impl Unpin for Bar

§

impl UnwindSafe for Bar

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.