mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-01 02:31:04 +02:00
feat: new focused window module
This commit is contained in:
parent
e416e03b0a
commit
dc14cb003f
13 changed files with 222 additions and 88 deletions
25
src/bar.rs
25
src/bar.rs
|
@ -48,14 +48,14 @@ fn load_modules(
|
|||
right: >k::Box,
|
||||
app: &Application,
|
||||
config: Config,
|
||||
output_name: &str
|
||||
output_name: &str,
|
||||
) {
|
||||
if let Some(modules) = config.left {
|
||||
let info = ModuleInfo {
|
||||
app,
|
||||
location: ModuleLocation::Left,
|
||||
bar_position: &config.position,
|
||||
output_name
|
||||
output_name,
|
||||
};
|
||||
|
||||
add_modules(left, modules, info);
|
||||
|
@ -66,7 +66,7 @@ fn load_modules(
|
|||
app,
|
||||
location: ModuleLocation::Center,
|
||||
bar_position: &config.position,
|
||||
output_name
|
||||
output_name,
|
||||
};
|
||||
|
||||
add_modules(center, modules, info);
|
||||
|
@ -77,7 +77,7 @@ fn load_modules(
|
|||
app,
|
||||
location: ModuleLocation::Right,
|
||||
bar_position: &config.position,
|
||||
output_name
|
||||
output_name,
|
||||
};
|
||||
|
||||
add_modules(right, modules, info);
|
||||
|
@ -122,6 +122,11 @@ fn add_modules(content: >k::Box, modules: Vec<ModuleConfig>, info: ModuleInfo)
|
|||
widget.set_widget_name("script");
|
||||
content.add(&widget);
|
||||
}
|
||||
ModuleConfig::Focused(module) => {
|
||||
let widget = module.into_widget(&info);
|
||||
widget.set_widget_name("focused");
|
||||
content.add(&widget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -137,8 +142,16 @@ fn setup_layer_shell(win: &ApplicationWindow, monitor: &Monitor, position: &BarP
|
|||
gtk_layer_shell::set_margin(win, gtk_layer_shell::Edge::Left, 0);
|
||||
gtk_layer_shell::set_margin(win, gtk_layer_shell::Edge::Right, 0);
|
||||
|
||||
gtk_layer_shell::set_anchor(win, gtk_layer_shell::Edge::Top, position == &BarPosition::Top);
|
||||
gtk_layer_shell::set_anchor(win, gtk_layer_shell::Edge::Bottom, position == &BarPosition::Bottom);
|
||||
gtk_layer_shell::set_anchor(
|
||||
win,
|
||||
gtk_layer_shell::Edge::Top,
|
||||
position == &BarPosition::Top,
|
||||
);
|
||||
gtk_layer_shell::set_anchor(
|
||||
win,
|
||||
gtk_layer_shell::Edge::Bottom,
|
||||
position == &BarPosition::Bottom,
|
||||
);
|
||||
gtk_layer_shell::set_anchor(win, gtk_layer_shell::Edge::Left, true);
|
||||
gtk_layer_shell::set_anchor(win, gtk_layer_shell::Edge::Right, true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue