Struct ResizeBarStyle

Source
pub struct ResizeBarStyle {
    pub hit_thickness: f32,
    pub line_thickness: f32,
    pub idle_color: Color,
    pub hover_color: Color,
    pub active_color: Color,
    pub radius: f32,
    pub vertical_extent: f32,
    pub horizontal_extent: f32,
}
Expand description

Hit geometry, visible line geometry, and colors for ResizeBar.

All dimensions are logical pixels and are consumed without global normalization. Defaults use an 8-pixel hit target, a 2-pixel line, and a 64-pixel intrinsic extent along the bar.

§Examples

use ailloli_ui_widgets::layout::ResizeBarStyle;
let style = ResizeBarStyle::default();
assert_eq!(style.hit_thickness, 8.0);
assert_eq!(style.line_thickness, 2.0);

Fields§

§hit_thickness: f32

Hit target thickness on the resize axis.

§line_thickness: f32

Centered visible line thickness.

§idle_color: Color

Line color when neither hovered nor dragging.

§hover_color: Color

Line color while hovered.

§active_color: Color

Line color while dragging.

§radius: f32

Visible line corner radius.

§vertical_extent: f32

Default height of a vertical (X) bar.

§horizontal_extent: f32

Default width of a horizontal (Y) bar.

Implementations§

Source§

impl ResizeBarStyle

Source

pub fn from_theme(theme: Theme) -> Self

Derives colors from theme and uses the standard geometry defaults.

§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::layout::ResizeBarStyle;
assert_eq!(ResizeBarStyle::from_theme(Theme::dark()).vertical_extent, 64.0);
Source

pub fn intrinsic_size(&self, axis: ResizeAxis) -> Size

Returns the axis-oriented intrinsic size in logical pixels.

Values are passed through without clamping.

§Examples
use ailloli_ui_core::Size;
use ailloli_ui_widgets::layout::{ResizeAxis, ResizeBarStyle};
let style = ResizeBarStyle::default();
assert_eq!(style.intrinsic_size(ResizeAxis::X), Size::new(8.0, 64.0));
assert_eq!(style.intrinsic_size(ResizeAxis::Y), Size::new(64.0, 8.0));

Trait Implementations§

Source§

impl Clone for ResizeBarStyle

Source§

fn clone(&self) -> ResizeBarStyle

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ResizeBarStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ResizeBarStyle

Derives resize-bar defaults from [Theme::default].

Source§

fn default() -> Self

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

impl PartialEq for ResizeBarStyle

Source§

fn eq(&self, other: &ResizeBarStyle) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for ResizeBarStyle

Source§

impl StructuralPartialEq for ResizeBarStyle

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<A> IntoClickAction<A> for A
where A: Clone + 'static,

§

fn into_click_action(self) -> ClickAction<A>

Implements the into_click_action helper used by this module.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> Brush for T
where T: Clone + PartialEq + Default + Debug,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Props for T
where T: Clone + 'static,