mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-03 19:51:03 +02:00
refactor: move most of the horrible add_module
macro content into proper functions
This commit is contained in:
parent
490f3f3f65
commit
2c1b2924d4
15 changed files with 317 additions and 344 deletions
|
@ -17,7 +17,6 @@ pub mod workspaces;
|
|||
use crate::config::BarPosition;
|
||||
use crate::popup::ButtonGeometry;
|
||||
use color_eyre::Result;
|
||||
use derive_builder::Builder;
|
||||
use glib::IsA;
|
||||
use gtk::gdk::Monitor;
|
||||
use gtk::{Application, Widget};
|
||||
|
@ -29,15 +28,12 @@ pub enum ModuleLocation {
|
|||
Center,
|
||||
Right,
|
||||
}
|
||||
|
||||
#[derive(Builder)]
|
||||
pub struct ModuleInfo<'a> {
|
||||
pub app: &'a Application,
|
||||
pub location: ModuleLocation,
|
||||
pub bar_position: BarPosition,
|
||||
pub monitor: &'a Monitor,
|
||||
pub output_name: &'a str,
|
||||
pub module_name: &'a str,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -73,6 +69,8 @@ where
|
|||
type SendMessage;
|
||||
type ReceiveMessage;
|
||||
|
||||
fn name() -> &'static str;
|
||||
|
||||
fn spawn_controller(
|
||||
&self,
|
||||
info: &ModuleInfo,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue