Skip to content

Commit b707f61

Browse files
committed
anyrun: restore layer config functionality
1 parent 4e0ebf9 commit b707f61

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

anyrun/src/main.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use relm4::prelude::*;
1616
use wl_clipboard_rs::copy;
1717

1818
use crate::{
19-
config::{Action, Config, ConfigArgs, Keybind},
19+
config::{Action, Config, ConfigArgs, Keybind, Layer},
2020
plugin_box::{PluginBox, PluginBoxInput, PluginBoxOutput, PluginMatch},
2121
};
2222

@@ -118,7 +118,12 @@ impl Component for App {
118118
view! {
119119
gtk::Window {
120120
init_layer_shell: (),
121-
set_layer: gtk4_layer_shell::Layer::Top,
121+
set_layer: match config.layer {
122+
Layer::Background => gtk4_layer_shell::Layer::Background,
123+
Layer::Bottom => gtk4_layer_shell::Layer::Bottom,
124+
Layer::Top => gtk4_layer_shell::Layer::Top,
125+
Layer::Overlay => gtk4_layer_shell::Layer::Overlay,
126+
},
122127
set_anchor: (Edge::Left, true),
123128
set_anchor: (Edge::Top, true),
124129
set_keyboard_mode: KeyboardMode::OnDemand,
@@ -332,9 +337,7 @@ impl Component for App {
332337
widgets.main.set_halign(gtk::Align::Fill);
333338
widgets.main.set_margin_start(x);
334339
widgets.main.set_margin_top(y);
335-
widgets
336-
.main
337-
.set_margin_end(mon_width as i32 - x - width);
340+
widgets.main.set_margin_end(mon_width as i32 - x - width);
338341
widgets
339342
.main
340343
.set_margin_bottom(mon_height as i32 - y - height);

0 commit comments

Comments
 (0)