diff --git a/src/bar.rs b/src/bar.rs index d15bd73..27af61a 100644 --- a/src/bar.rs +++ b/src/bar.rs @@ -60,7 +60,7 @@ impl Bar { window.set_widget_name(&name); let position = config.position; - let orientation = position.get_orientation(); + let orientation = position.orientation(); let content = gtk::Box::builder() .orientation(orientation) @@ -187,7 +187,7 @@ impl Bar { win.set_layer_shell_margin(gtk_layer_shell::Edge::Left, margin.left); win.set_layer_shell_margin(gtk_layer_shell::Edge::Right, margin.right); - let bar_orientation = position.get_orientation(); + let bar_orientation = position.orientation(); win.set_anchor( gtk_layer_shell::Edge::Top, @@ -351,7 +351,7 @@ fn add_modules( ironbar: &Rc, popup: &Rc>, ) -> Result<()> { - let orientation = info.bar_position.get_orientation(); + let orientation = info.bar_position.orientation(); macro_rules! add_module { ($module:expr, $id:expr) => {{ diff --git a/src/config/impl.rs b/src/config/impl.rs index c60e292..7b9e65d 100644 --- a/src/config/impl.rs +++ b/src/config/impl.rs @@ -38,7 +38,7 @@ impl<'de> Deserialize<'de> for MonitorConfig { impl BarPosition { /// Gets the orientation the bar and widgets should use /// based on this position. - pub fn get_orientation(self) -> Orientation { + pub fn orientation(self) -> Orientation { if self == Self::Top || self == Self::Bottom { Orientation::Horizontal } else { diff --git a/src/modules/custom/mod.rs b/src/modules/custom/mod.rs index 6ec7027..b6e97b9 100644 --- a/src/modules/custom/mod.rs +++ b/src/modules/custom/mod.rs @@ -194,7 +194,7 @@ impl Module for CustomModule { context: WidgetContext, info: &ModuleInfo, ) -> Result> { - let orientation = info.bar_position.get_orientation(); + let orientation = info.bar_position.orientation(); let container = gtk::Box::builder().orientation(orientation).build(); let popup_buttons = Rc::new(RefCell::new(Vec::new())); @@ -236,7 +236,7 @@ impl Module for CustomModule { if let Some(popup) = self.popup { let custom_context = CustomWidgetContext { tx: &tx, - bar_orientation: info.bar_position.get_orientation(), + bar_orientation: info.bar_position.orientation(), icon_theme: info.icon_theme, popup_buttons: Rc::new(RefCell::new(vec![])), }; diff --git a/src/modules/focused.rs b/src/modules/focused.rs index ce288e1..8c32c2b 100644 --- a/src/modules/focused.rs +++ b/src/modules/focused.rs @@ -113,7 +113,7 @@ impl Module for FocusedModule { ) -> Result> { let icon_theme = info.icon_theme; - let container = gtk::Box::new(info.bar_position.get_orientation(), 5); + let container = gtk::Box::new(info.bar_position.orientation(), 5); let icon = gtk::Image::new(); if self.show_icon { diff --git a/src/modules/launcher/item.rs b/src/modules/launcher/item.rs index d312cd8..ba4407d 100644 --- a/src/modules/launcher/item.rs +++ b/src/modules/launcher/item.rs @@ -225,9 +225,7 @@ impl ItemButton { try_send!( tx, - ModuleUpdateEvent::OpenPopupAt( - button.geometry(bar_position.get_orientation()) - ) + ModuleUpdateEvent::OpenPopupAt(button.geometry(bar_position.orientation())) ); } else { try_send!(tx, ModuleUpdateEvent::ClosePopup); diff --git a/src/modules/launcher/mod.rs b/src/modules/launcher/mod.rs index c231cc8..41a7931 100644 --- a/src/modules/launcher/mod.rs +++ b/src/modules/launcher/mod.rs @@ -301,7 +301,7 @@ impl Module for LauncherModule { ) -> crate::Result> { let icon_theme = info.icon_theme; - let container = gtk::Box::new(info.bar_position.get_orientation(), 0); + let container = gtk::Box::new(info.bar_position.orientation(), 0); { let container = container.clone(); diff --git a/src/modules/sysinfo.rs b/src/modules/sysinfo.rs index 420d923..c815110 100644 --- a/src/modules/sysinfo.rs +++ b/src/modules/sysinfo.rs @@ -188,7 +188,7 @@ impl Module for SysInfoModule { ) -> Result> { let re = Regex::new(r"\{([^}]+)}")?; - let container = gtk::Box::new(info.bar_position.get_orientation(), 10); + let container = gtk::Box::new(info.bar_position.orientation(), 10); let mut labels = Vec::new(); diff --git a/src/modules/tray/mod.rs b/src/modules/tray/mod.rs index 5231e09..cf4a2ff 100644 --- a/src/modules/tray/mod.rs +++ b/src/modules/tray/mod.rs @@ -89,7 +89,7 @@ impl Module for TrayModule { let container = MenuBar::new(); let direction = self.direction.unwrap_or( - if info.bar_position.get_orientation() == gtk::Orientation::Vertical { + if info.bar_position.orientation() == gtk::Orientation::Vertical { PackDirection::Ttb } else { PackDirection::Ltr diff --git a/src/modules/workspaces.rs b/src/modules/workspaces.rs index 2e9c4ee..40c30c5 100644 --- a/src/modules/workspaces.rs +++ b/src/modules/workspaces.rs @@ -189,7 +189,7 @@ impl Module for WorkspacesModule { context: WidgetContext, info: &ModuleInfo, ) -> Result> { - let container = gtk::Box::new(info.bar_position.get_orientation(), 0); + let container = gtk::Box::new(info.bar_position.orientation(), 0); let name_map = self.name_map.clone().unwrap_or_default(); let favs = self.favorites.clone();