pub struct AppBar {
pub title: String,
pub title_size: f32,
pub background: Color,
pub foreground: Color,
pub border_color: Color,
pub leading: Option<BoxedWidget>,
pub actions: Vec<BoxedWidget>,
/* private fields */
}Expand description
A top app bar with title, leading, and trailing action slots.
Platform-adaptive (D105 Phase 23): height, show_traffic_lights, and
title alignment default to the active theme’s app_bar style
(ThemeData::app_bar, an rosace_theme::AppBarStyle) — the SAME
widget renders macOS/iOS/Android-appropriate chrome purely from theme
data, no platform branch in this file. Per-instance builder calls
(.height(..), .traffic_lights()) override the theme for that one
instance; a widget that doesn’t call them follows the theme.
Fields§
§title: String§title_size: f32§background: Color§foreground: Color§border_color: Color§leading: Option<BoxedWidget>§actions: Vec<BoxedWidget>Implementations§
Source§impl AppBar
impl AppBar
pub fn new(title: impl Into<String>) -> Self
pub fn background(self, c: Color) -> Self
pub fn foreground(self, c: Color) -> Self
Sourcepub fn height(self, h: f32) -> Self
pub fn height(self, h: f32) -> Self
Overrides the active theme’s app-bar height for this instance.
pub fn leading(self, w: impl Widget + 'static) -> Self
pub fn action(self, w: impl Widget + 'static) -> Self
Sourcepub fn no_traffic_lights(self) -> Self
pub fn no_traffic_lights(self) -> Self
Overrides the active theme’s traffic-light setting for this instance.
Sourcepub fn traffic_lights(self) -> Self
pub fn traffic_lights(self) -> Self
Draw faux macOS traffic-light dots (only for standalone mockup screenshots — a real app window already has real OS traffic lights). Overrides the active theme’s traffic-light setting for this instance.
pub fn title_size(self, s: f32) -> Self
Sourcepub fn material(self, m: ShaderMaterial) -> Self
pub fn material(self, m: ShaderMaterial) -> Self
Per-instance shader material — replaces the bar fill when resolved.
Beats the theme’s AppBarMaterial default (D124 Step 5).
Trait Implementations§
Source§impl Widget for AppBar
impl Widget for AppBar
Source§fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
ctx.constraints and return a size within them. Read more