feat: Add UI for start screen settings
This commit is contained in:
1
src/features/start_screen/ui/mod.rs
Normal file
1
src/features/start_screen/ui/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod settings;
|
||||
71
src/features/start_screen/ui/settings.rs
Normal file
71
src/features/start_screen/ui/settings.rs
Normal file
@@ -0,0 +1,71 @@
|
||||
use crate::features::hud::components::TimerType;
|
||||
use crate::features::hud::ui::timer_settings::timer_settings;
|
||||
use crate::features::start_screen::components::RootMarker;
|
||||
use crate::prelude::*;
|
||||
|
||||
/// Spawns the settings popup for the start screen.
|
||||
pub fn open_settings_menu(commands: &mut Commands) {
|
||||
spawn_popup(
|
||||
commands,
|
||||
RootMarker::Settings,
|
||||
"Einstellungen",
|
||||
Node {
|
||||
width: px(700),
|
||||
..default()
|
||||
},
|
||||
|parent| {
|
||||
parent.spawn((
|
||||
Node {
|
||||
justify_content: JustifyContent::Center,
|
||||
..Node::hstack(px(30))
|
||||
},
|
||||
children![
|
||||
(
|
||||
Node {
|
||||
width: percent(40),
|
||||
..Node::vstack(px(10))
|
||||
},
|
||||
children![
|
||||
text("Timer Einstellungen", 18.0, Color::WHITE),
|
||||
text(
|
||||
"Tipp: Benutze [Umschalt] um in 10er Schritten zu inkrementieren oder dekrementieren!",
|
||||
16.0,
|
||||
Color::WHITE
|
||||
),
|
||||
]
|
||||
),
|
||||
(
|
||||
Node {
|
||||
align_items: AlignItems::Center,
|
||||
..Node::vstack(px(10))
|
||||
},
|
||||
children![
|
||||
text("Fokus Phase", 12.0, Color::WHITE),
|
||||
timer_settings(TimerType::Focus)
|
||||
]
|
||||
),
|
||||
(
|
||||
Node {
|
||||
align_items: AlignItems::Center,
|
||||
..Node::vstack(px(10))
|
||||
},
|
||||
children![
|
||||
text("Kurze Pause", 12.0, Color::WHITE),
|
||||
timer_settings(TimerType::ShortBreak)
|
||||
]
|
||||
),
|
||||
(
|
||||
Node {
|
||||
align_items: AlignItems::Center,
|
||||
..Node::vstack(px(10))
|
||||
},
|
||||
children![
|
||||
text("Lange Pause", 12.0, Color::WHITE),
|
||||
timer_settings(TimerType::LongBreak)
|
||||
]
|
||||
)
|
||||
],
|
||||
));
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user