diff options
| author | Rubén Beltrán del Río <jj@r.bdr.sh> | 2026-01-16 00:08:41 +0100 |
|---|---|---|
| committer | Rubén Beltrán del Río <jj@r.bdr.sh> | 2026-01-16 00:12:53 +0100 |
| commit | 04b1e6080d99601b8d6343be3140f545cd8f9eae (patch) | |
| tree | 2180b7d50f2442e5d18a99a87e56def29b02f68e /src/handlers/view.rs | |
| parent | ab6492a9f9b8a65121fcf10ff5a44660bd063af1 (diff) | |
Separate concerns
Diffstat (limited to 'src/handlers/view.rs')
| -rw-r--r-- | src/handlers/view.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/handlers/view.rs b/src/handlers/view.rs new file mode 100644 index 0000000..64aeb98 --- /dev/null +++ b/src/handlers/view.rs @@ -0,0 +1,20 @@ +use relm4::gtk; + +use crate::AppModel; +use crate::stages::ALL_STAGE_TYPES; + +/// Toggles between horizontal and vertical layout orientation. +pub fn change_orientation(model: &mut AppModel) { + model.orientation = match model.orientation { + gtk::Orientation::Horizontal => gtk::Orientation::Vertical, + _ => gtk::Orientation::Horizontal, + }; +} + +/// Updates the selected stage type from dropdown selection. +pub fn stage_type_selected(model: &mut AppModel, index: usize) { + if index < ALL_STAGE_TYPES.len() { + model.stage_type = ALL_STAGE_TYPES[index]; + model.update_image(); + } +} |