Skip to content

Commit 1f584be

Browse files
committed
Toggle old/new with space
1 parent 2537253 commit 1f584be

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/viewer/viewer_options.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use crate::state::{SystemCommand, ViewerAppStateRef, ViewerSystemCommand};
22
use crate::{settings::ImageMode, state::View};
3-
use eframe::egui::{Slider, TextureFilter, Ui};
3+
use eframe::egui::{self, Slider, TextureFilter, Ui};
44

55
pub fn viewer_options(ui: &mut Ui, state: &ViewerAppStateRef<'_>) {
66
let mut settings = state.app.settings.clone();
77

88
ui.group(|ui| {
9-
ui.strong("View only");
9+
ui.strong("View");
1010
let mut new_view = state.view;
1111

1212
for view in View::ALL {
@@ -17,6 +17,15 @@ pub fn viewer_options(ui: &mut Ui, state: &ViewerAppStateRef<'_>) {
1717
);
1818
}
1919

20+
ui.label("Toggle old/new with SPACE");
21+
if ui.input_mut(|i| i.consume_key(egui::Modifiers::default(), egui::Key::Space)) {
22+
if new_view == View::Old {
23+
new_view = View::New;
24+
} else {
25+
new_view = View::Old;
26+
}
27+
}
28+
2029
if new_view != state.view {
2130
state.app.send(ViewerSystemCommand::SetView(new_view));
2231
}

0 commit comments

Comments
 (0)