Add gtk-layer-shell overlay ability

Signed-off-by: Vasiliy Doylov <nekocwd@mainlining.org>
This commit is contained in:
Vasiliy Doylov 2025-03-14 01:35:37 +03:00
parent 87b4f223c7
commit f9442af5ed
Signed by: NekoCWD
GPG key ID: B7BE22D44474A582
2 changed files with 16 additions and 3 deletions

View file

@ -8,6 +8,7 @@ pipetap_deps = [
config_dep,
dependency('gtk4'),
dependency('libadwaita-1', version: '>= 1.4'),
dependency('gtk4-layer-shell-0'),
]
blueprints = custom_target(

View file

@ -18,12 +18,24 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
[GtkTemplate (ui = "/io/gitlab/nekocwd/pipetap/window.ui")]
[GtkTemplate(ui = "/io/gitlab/nekocwd/pipetap/window.ui")]
public class PipeTap.Window : Adw.ApplicationWindow {
[GtkChild]
private unowned Gtk.Label label;
public Window (Gtk.Application app) {
Object (application: app);
public Window(Gtk.Application app) {
Object(application: app);
GtkLayerShell.init_for_window(this);
set_position();
}
void set_position() {
GtkLayerShell.set_anchor(this, GtkLayerShell.Edge.BOTTOM, true);
GtkLayerShell.set_anchor(this, GtkLayerShell.Edge.BOTTOM, true);
GtkLayerShell.set_anchor(this, GtkLayerShell.Edge.LEFT, true);
GtkLayerShell.set_margin(this, GtkLayerShell.Edge.TOP, 100);
GtkLayerShell.set_margin(this, GtkLayerShell.Edge.BOTTOM, 100);
GtkLayerShell.set_margin(this, GtkLayerShell.Edge.LEFT, 100);
}
}