1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
use bevy::{feathers::theme::ThemedText, prelude::*};
use crate::tokens;
/// Marker for the status bar root node.
#[derive(Component)]
pub struct StatusBar;
/// Marker for the left status text (selection info).
#[derive(Component)]
pub struct StatusBarLeft;
/// Marker for the center status text (scene statistics).
#[derive(Component)]
pub struct StatusBarCenter;
/// Marker for the right status text (gizmo mode, scene path).
#[derive(Component)]
pub struct StatusBarRight;
/// Build the styled status bar bundle (22px bar at bottom).
pub fn status_bar() -> impl Bundle {
(
StatusBar,
Node {
flex_direction: FlexDirection::Row,
align_items: AlignItems::Center,
justify_content: JustifyContent::SpaceBetween,
width: Val::Percent(100.0),
height: Val::Px(tokens::STATUS_BAR_HEIGHT),
padding: UiRect::horizontal(Val::Px(tokens::SPACING_MD)),
flex_shrink: 0.0,
..Default::default()
},
BackgroundColor(tokens::WINDOW_BG),
children![
(
StatusBarLeft,
Text::new("Ready"),
TextFont {
font_size: tokens::FONT_SM,
..Default::default()
},
ThemedText,
),
(
StatusBarCenter,
Text::new(""),
TextFont {
font_size: tokens::FONT_SM,
..Default::default()
},
TextColor(tokens::TEXT_SECONDARY),
),
(
StatusBarRight,
Text::new(""),
TextFont {
font_size: tokens::FONT_SM,
..Default::default()
},
TextColor(tokens::TEXT_SECONDARY),
)
],
)
}