Skip to content

Commit c1f6190

Browse files
committed
tweak preset for screenshots
1 parent aded9b5 commit c1f6190

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

apps/notation_viewer/src/viewer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ impl NotationViewer {
8484
Control::toggle_hide_mini_map(&mut app_state, &mut settings, &mut theme);
8585
} else if keyboard_input.just_released(KeyCode::F5) || keyboard_input.just_released(KeyCode::R)
8686
{
87+
app_state.bars_range = None;
8788
Control::reload_tab(&mut app_state, &mut theme);
8889
} else if keyboard_input.just_released(KeyCode::Space) {
8990
MidiControl::play_or_pause(&mut midi_state, &mut play_control_evts);

crates/notation_bevy/src/notation/control.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,36 @@ impl Control {
9292
}
9393
window.set_resolution(width as f32, height as f32);
9494
}
95+
pub fn set_primary_window_size(windows: &mut Windows, width: usize, height: usize) {
96+
if let Some(window) = windows.get_primary_mut() {
97+
Self::set_window_size(window, width, height);
98+
}
99+
}
95100
pub fn set_preset(
96101
state: &mut NotationState,
97102
settings: &mut NotationSettings,
98103
theme: &mut NotationTheme,
104+
windows: &mut Windows,
99105
_window_resized_evts: &mut EventWriter<WindowResizedEvent>,
100106
preset: &'static str,
101107
) {
102108
match preset {
103109
Self::PRESET_GUITAR_STRINGS => {
104110
state.preset = Some(preset.to_owned());
111+
settings.add_ready_section = false;
112+
settings.hide_indicators = true;
113+
settings.hide_guitar_view = true;
114+
settings.hide_chords_view = true;
105115
settings.hide_shapes_lane = true;
116+
settings.always_show_fret = true;
117+
settings.override_beat_size = Some(128.0);
106118
theme.sizes.strings.string_space = 20.0;
107119
theme.sizes.strings.note_height = 9.0;
108-
theme.texts.strings.text_y = 6.0;
120+
theme.texts.strings.fret_font_size = 20.0;
121+
theme.texts.strings.text_y = 8.0;
122+
theme.sizes.layout.page_margin = 24.0;
123+
#[cfg(not(target_arch = "wasm32"))]
124+
Self::set_primary_window_size(windows, 1280, 1920);
109125
Self::reload_tab(state, theme);
110126
},
111127
_ => {},

crates/notation_bevy/src/notation/control_panel.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ impl ControlPanel {
622622
state: &mut NotationState,
623623
settings: &mut NotationSettings,
624624
theme: &mut NotationTheme,
625+
windows: &mut Windows,
625626
window_resized_evts: &mut EventWriter<WindowResizedEvent>,
626627
) {
627628
CollapsingHeader::new(format!(
@@ -632,7 +633,7 @@ impl ControlPanel {
632633
.show(ui, |ui| {
633634
ui.horizontal(|ui| {
634635
if ui.button(Control::PRESET_GUITAR_STRINGS).clicked() {
635-
Control::set_preset(state, settings, theme, window_resized_evts, Control::PRESET_GUITAR_STRINGS);
636+
Control::set_preset(state, settings, theme, windows, window_resized_evts, Control::PRESET_GUITAR_STRINGS);
636637
}
637638
});
638639
});
@@ -696,7 +697,7 @@ impl ControlPanel {
696697
);
697698
Self::display_ui(ui, &mut state, &mut settings, &mut theme);
698699
ui.separator();
699-
Self::presets_ui(ui, &mut state, &mut settings, &mut theme, &mut window_resized_evts);
700+
Self::presets_ui(ui, &mut state, &mut settings, &mut theme, &mut windows, &mut window_resized_evts);
700701
ui.separator();
701702
Self::layout_ui(ui, &mut state, &mut settings, &mut theme);
702703
Self::overrides_ui(

crates/notation_bevy/src/theme/theme_texts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ impl Default for StringsTexts {
291291
fn default() -> Self {
292292
Self {
293293
text_x: 2.0,
294-
text_y: -2.0,
294+
text_y: 6.0,
295295
text_z: 1.0,
296296
fret_font_size: 18.0,
297297
fret_font_color: Color::hex("000000").unwrap(),

0 commit comments

Comments
 (0)