Feat: demo songs

This commit is contained in:
2026-02-22 23:50:35 +01:00
parent 81f475a75b
commit f47285385c
27 changed files with 25324 additions and 38 deletions

View File

@@ -249,6 +249,12 @@ pub fn render(frame: &mut Frame, app: &App, link: &LinkState, area: Rect) {
focus == OptionsFocus::ResetOnboarding,
&theme,
),
render_option_line(
"Demo on startup",
if app.ui.load_demo_on_startup { "On" } else { "Off" },
focus == OptionsFocus::LoadDemoOnStartup,
&theme,
),
]);
}
@@ -358,6 +364,7 @@ fn option_description(focus: OptionsFocus) -> Option<&'static str> {
OptionsFocus::MidiInput2 => Some("MIDI input device for channel group 3"),
OptionsFocus::MidiInput3 => Some("MIDI input device for channel group 4"),
OptionsFocus::ResetOnboarding => Some("Re-enable all dismissed guide popups"),
OptionsFocus::LoadDemoOnStartup => Some("Load a rotating demo song on fresh startup"),
}
}

View File

@@ -559,6 +559,9 @@ fn render_mini_tile_grid(
let row_gap: u16 = 1;
let max_tile_height: u16 = 4;
let max_rows = (area.height as usize + row_gap as usize) / (1 + row_gap as usize);
let num_rows = num_rows.min(max_rows.max(1));
let available_for_rows =
area.height.saturating_sub((num_rows.saturating_sub(1) as u16) * row_gap);
let tile_height = (available_for_rows / num_rows as u16).min(max_tile_height).max(1);