pub struct WorkbenchStyle {
pub density: Density,
pub control_radius: u8,
pub item_radius: u8,
pub inner_radius: u8,
pub container_radius: u8,
pub dialog_radius: u8,
pub pill_radius: u8,
pub border_width: f32,
pub text_scale: f32,
}Expand description
Shape and density shared by every component.
Fields§
§density: DensityControl and row heights.
control_radius: u8Buttons, text fields, selects, steppers, context menus, and egui widgets.
item_radius: u8Hover fills of icon buttons, nav items, and segmented controls.
inner_radius: u8Small shapes inside other shapes: menu and tree rows, checkboxes, segments,
toolbar buttons. Tiny hover targets use one point less (Self::tight).
container_radius: u8Cards, popovers, legends, and egui windows.
dialog_radius: u8Modal dialogs and toasts.
pill_radius: u8Capsules: badges, switches, and the title-bar search. Clamped to half the shape’s height, so the default draws full capsules at any height.
border_width: f32Borders of controls, cards, popovers, and dialogs (0.0 removes them).
Separators and focus rings keep their own widths.
text_scale: f32Multiplies every font size (body, buttons, menus, chrome). Clamped to
0.75..=1.5; heights follow the density, not the text.
Implementations§
Source§impl WorkbenchStyle
impl WorkbenchStyle
Sourcepub fn sharp() -> WorkbenchStyle
pub fn sharp() -> WorkbenchStyle
Square corners everywhere, for a flat or “technical” look.
Sourcepub fn rounded() -> WorkbenchStyle
pub fn rounded() -> WorkbenchStyle
Larger radii for a softer look.
Sourcepub fn with_density(self, density: Density) -> WorkbenchStyle
pub fn with_density(self, density: Density) -> WorkbenchStyle
The same style with another density.
Sourcepub fn scaled(&self, height: f32) -> f32
pub fn scaled(&self, height: f32) -> f32
A reference height scaled by the density, on whole points.
Sourcepub fn control_height(&self) -> f32
pub fn control_height(&self) -> f32
Height of text fields, selects, steppers, and dialog buttons.
Sourcepub fn size_height(&self, size: Size) -> f32
pub fn size_height(&self, size: Size) -> f32
Height of a builder button of size.
Sourcepub fn size_padding(&self, size: Size) -> Vec2
pub fn size_padding(&self, size: Size) -> Vec2
Button padding of size, vertical part scaled by the density.
Height of a context-menu row.
Sourcepub fn list_row_height(&self) -> f32
pub fn list_row_height(&self) -> f32
Height of a palette or keyboard-menu row.
Sourcepub fn tree_row_height(&self) -> f32
pub fn tree_row_height(&self) -> f32
Height of an explorer tree row.
Sourcepub fn control(&self) -> CornerRadius
pub fn control(&self) -> CornerRadius
Corner radius of controls.
Sourcepub fn item(&self) -> CornerRadius
pub fn item(&self) -> CornerRadius
Corner radius of row and icon hover fills.
Sourcepub fn container(&self) -> CornerRadius
pub fn container(&self) -> CornerRadius
Corner radius of cards, popovers, and menus.
Sourcepub fn dialog(&self) -> CornerRadius
pub fn dialog(&self) -> CornerRadius
Corner radius of dialogs and toasts.
Sourcepub fn inner(&self) -> CornerRadius
pub fn inner(&self) -> CornerRadius
Corner radius of shapes nested in other shapes (menu rows, checkboxes).
Sourcepub fn tight(&self) -> CornerRadius
pub fn tight(&self) -> CornerRadius
One point under Self::inner: tiny hover targets such as a tab’s close
button or a stepper arrow.
Sourcepub fn mark(&self) -> CornerRadius
pub fn mark(&self) -> CornerRadius
Indicator bars and underlines (1 pt, square in a sharp style).
Sourcepub fn pill(&self, height: f32) -> CornerRadius
pub fn pill(&self, height: f32) -> CornerRadius
Corner radius of a capsule height points tall.
Sourcepub fn text_scale(&self) -> f32
pub fn text_scale(&self) -> f32
The effective text scale.
Sourcepub fn font_size(&self, points: f32) -> f32
pub fn font_size(&self, points: f32) -> f32
A reference font size (in points) scaled by Self::text_scale.
Trait Implementations§
Source§impl Clone for WorkbenchStyle
impl Clone for WorkbenchStyle
Source§fn clone(&self) -> WorkbenchStyle
fn clone(&self) -> WorkbenchStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WorkbenchStyle
Source§impl Debug for WorkbenchStyle
impl Debug for WorkbenchStyle
Source§impl Default for WorkbenchStyle
impl Default for WorkbenchStyle
Source§fn default() -> WorkbenchStyle
fn default() -> WorkbenchStyle
Source§impl PartialEq for WorkbenchStyle
impl PartialEq for WorkbenchStyle
impl StructuralPartialEq for WorkbenchStyle
Auto Trait Implementations§
impl Forget for WorkbenchStyle
impl Freeze for WorkbenchStyle
impl Move for WorkbenchStyle
impl RefUnwindSafe for WorkbenchStyle
impl Send for WorkbenchStyle
impl Sync for WorkbenchStyle
impl Unpin for WorkbenchStyle
impl UnsafeUnpin for WorkbenchStyle
impl UnwindSafe for WorkbenchStyle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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