pub struct WidgetBorderSpec {
pub color: Option<Rgba>,
pub corner_radius: Option<f32>,
pub line_width: Option<f32>,
pub shadow_enabled: Option<bool>,
pub padding_top: Option<f32>,
pub padding_right: Option<f32>,
pub padding_bottom: Option<f32>,
pub padding_left: Option<f32>,
}Expand description
Widget-level border specification: color, geometry, and padding.
Used on per-widget structs for border properties specific to individual
widgets. Unlike DefaultsBorderSpec, includes the four padding sides
(widget-level layout) but omits corner_radius_lg and opacity
(defaults-only geometry).
Padding fields are widget-only because different widgets need different internal padding even when sharing the same border geometry from defaults.
Padding is per side. A platform states padding side by side, and some
sides differ (Windows’ input is 10 left / 6 right, docs/platform-facts.md
§2.4), so the model stores the four sides and nothing else. None means
the platform states no value for that side; Some(0.0) means it states
zero.
TOML. The sides are padding_top_px, padding_right_px,
padding_bottom_px and padding_left_px. padding_horizontal_px and
padding_vertical_px are parse-time shorthand that set both sides of
their axis. A table that states an axis key together with one of that
axis’s sides is a parse error naming both keys. Serialisation writes
sides only.
All fields are optional to support partial overlays, and they merge per field, the overlay winning, so a reader’s left side over a preset’s shorthand replaces the left side alone.
Fields§
§color: Option<Rgba>Border color.
corner_radius: Option<f32>Corner radius in logical pixels.
line_width: Option<f32>Border stroke width in logical pixels.
shadow_enabled: Option<bool>Whether the bordered element has a drop shadow.
padding_top: Option<f32>Padding inside the border above the content, in logical pixels.
padding_right: Option<f32>Padding inside the border right of the content, in logical pixels.
padding_bottom: Option<f32>Padding inside the border below the content, in logical pixels.
padding_left: Option<f32>Padding inside the border left of the content, in logical pixels.