aboutsummaryrefslogtreecommitdiff
path: root/src/components/header.rs
diff options
context:
space:
mode:
authorRubén Beltrán del Río <jj@r.bdr.sh>2026-03-26 23:26:23 +0100
committerRubén Beltrán del Río <jj@r.bdr.sh>2026-03-26 23:44:35 +0100
commitc2465ff46ea2503cf839efdd90ccc5174f84fbe8 (patch)
treea02e710e04bb1b1068534427b5bb8235f1071cde /src/components/header.rs
parent1f28cbdf1dbe26e4c7da27323a0202a3276cb3a7 (diff)
Address clippy issues
Diffstat (limited to 'src/components/header.rs')
-rw-r--r--src/components/header.rs24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/components/header.rs b/src/components/header.rs
index 7a39490..6c1055b 100644
--- a/src/components/header.rs
+++ b/src/components/header.rs
@@ -1,19 +1,17 @@
use gtk::{gio, prelude::*};
-use relm4::prelude::*;
use relm4::actions::{ActionablePlus, RelmAction};
+use relm4::prelude::*;
use wmap_renderer::StageType;
-use crate::tr;
use crate::preferences::models::{CustomStage, Template};
use crate::stages::{ALL_STAGE_TYPES, LocalizedStageType};
+use crate::tr;
-use crate::{
- ChangeOrientationAction, ExportImageAction, actions::Action
-};
use crate::icon_names::shipped::{
- IMAGE_REGULAR, MENU_LARGE, SPLIT_HORIZONTAL_REGULAR, SPLIT_VERTICAL_REGULAR
+ IMAGE_REGULAR, MENU_LARGE, SPLIT_HORIZONTAL_REGULAR, SPLIT_VERTICAL_REGULAR,
};
+use crate::{ChangeOrientationAction, ExportImageAction, actions::Action};
// Model and Input Messages
@@ -24,7 +22,7 @@ pub struct Header {
horizontal_layout_enabled: bool,
templates_menu: gio::Menu,
main_menu: gio::Menu,
- layout_action: RelmAction<ChangeOrientationAction>
+ layout_action: RelmAction<ChangeOrientationAction>,
}
pub struct HeaderInit {
@@ -43,7 +41,7 @@ pub enum HeaderAction {
SetCustomStages(Vec<CustomStage>),
// Internal
- StageTypeSelected(usize)
+ StageTypeSelected(usize),
}
#[relm4::component(pub)]
@@ -110,7 +108,7 @@ impl SimpleComponent for Header {
horizontal_layout_enabled: init.horizontal_layout_enabled,
layout_action: init.layout_action,
templates_menu,
- main_menu
+ main_menu,
};
let widgets = view_output!();
@@ -124,7 +122,7 @@ impl SimpleComponent for Header {
HeaderAction::SetHorizontalLayoutEnabled(is_enabled) => {
self.horizontal_layout_enabled = is_enabled;
self.layout_action.set_enabled(is_enabled);
- },
+ }
HeaderAction::SetLayoutOrientation(orientation) => self.orientation = orientation,
HeaderAction::SetTemplates(templates) => {
self.templates_menu.remove_all();
@@ -134,17 +132,17 @@ impl SimpleComponent for Header {
Some(&format!("window.new-from-template::{}", template.id)),
);
}
- },
+ }
HeaderAction::SetCustomStages(stages) => {
self.rebuild_custom_stages(&stages);
- },
+ }
HeaderAction::StageTypeSelected(index) => {
if index < self.available_stage_types.len()
&& let Some(stage_type) = self.available_stage_types.get(index)
{
let _ = sender.output(Action::StageTypeSelected(stage_type.clone()));
}
- },
+ }
}
}
}