pub struct ResolvedWidgetBorder {
pub color: Rgba,
pub corner_radius: f32,
pub line_width: f32,
pub shadow_enabled: bool,
pub padding: ResolvedPadding,
}Expand description
A widget’s resolved border: its colour, geometry and padding.
No Default derive: Any “zero” instance is a
placeholder sentinel built manually (see
resolve::validate_helpers::resolved_widget_border_sentinel).
Fields§
§color: RgbaBorder color.
corner_radius: f32Corner radius in logical pixels.
line_width: f32Border stroke width in logical pixels.
shadow_enabled: boolWhether the bordered element has a drop shadow.
padding: ResolvedPaddingPadding inside the border, per side; a side the theme does not state
is None.
Implementations§
Source§impl ResolvedWidgetBorder
impl ResolvedWidgetBorder
Sourcepub fn padding_outside(&self) -> ResolvedPadding
pub fn padding_outside(&self) -> ResolvedPadding
The padding measured from the widget’s outer edge: each side
padding states plus line_width,
and None where it states none, so the toolkit keeps its own padding
there.
The theme’s padding lies inside the border (outer size = border +
padding + content, docs/platform-facts.md:904-906). A toolkit that
lays a widget’s content out its padding in from the widget’s edge and
paints the border over that padding, as iced and egui do, takes this,
and the content sits where the platform puts it; one whose box model
lays the padding inside the border (gpui) takes
padding.
On a resolved theme every length is finite and non-negative
(validation rejects any other). A finite side plus a finite width can
only overflow upwards, and that sum is f32::MAX, so a finite padding
stays finite; a non-finite side or width gives the f32 sum.