1#[path = "build_inspector.rs"]
2mod inspector;
3#[path = "build_playback_panel.rs"]
4mod playback_panel;
5
6use bevy::prelude::*;
7
8use crate::viewer::ViewerConfig;
9
10use super::{ACCENT_COLOR, BODY_COLOR};
11
12pub fn setup_ui(mut commands: Commands, asset_server: Res<AssetServer>, config: Res<ViewerConfig>) {
13 let font = asset_server.load("fonts/RobotoMono-VariableFont_wght.ttf");
14 let symbol_font = asset_server.load("fonts/NotoSansSymbols2-Regular.ttf");
15
16 inspector::spawn_inspector_panel(&mut commands, &font, &symbol_font);
17 playback_panel::spawn_playback_panel(&mut commands, &font, &symbol_font, config.as_ref());
18}
19
20pub(super) fn section_title_bundle(text: &str, font: &Handle<Font>) -> impl Bundle {
21 (
22 Text::new(text),
23 TextFont {
24 font: font.clone(),
25 font_size: 12.0,
26 ..default()
27 },
28 TextColor(ACCENT_COLOR),
29 )
30}
31
32pub(super) fn section_body_bundle(text: &str, font: &Handle<Font>) -> impl Bundle {
33 (
34 Text::new(text),
35 TextFont {
36 font: font.clone(),
37 font_size: 11.0,
38 ..default()
39 },
40 TextColor(BODY_COLOR),
41 )
42}