Add floating window logic
Signed-off-by: Vasiliy Doylov <nekocwd@mainlining.org>
This commit is contained in:
parent
f9442af5ed
commit
2e12fa26c4
21 changed files with 335 additions and 98 deletions
|
@ -19,6 +19,9 @@
|
|||
*/
|
||||
|
||||
public class PipeTap.Application : Adw.Application {
|
||||
public Settings settings;
|
||||
public bool adjust_overlay_visible { get; set; }
|
||||
|
||||
public Application () {
|
||||
Object (
|
||||
application_id: "io.gitlab.nekocwd.pipetap",
|
||||
|
@ -30,15 +33,25 @@ public class PipeTap.Application : Adw.Application {
|
|||
ActionEntry[] action_entries = {
|
||||
{ "about", this.on_about_action },
|
||||
{ "preferences", this.on_preferences_action },
|
||||
{ "quit", this.quit }
|
||||
{ "quit", this.quit },
|
||||
{ "adjust-overlays", () => { adjust_overlay_visible = !adjust_overlay_visible; } }
|
||||
};
|
||||
this.add_action_entries (action_entries, this);
|
||||
this.set_accels_for_action ("app.quit", { "<primary>q" });
|
||||
settings = new Settings ("io.gitlab.nekocwd.pipetap");
|
||||
}
|
||||
|
||||
public override void activate () {
|
||||
base.activate ();
|
||||
var win = this.active_window ?? new PipeTap.Window (this);
|
||||
|
||||
var styling = new Gtk.CssProvider ();
|
||||
styling.load_from_resource ("/io/gitlab/nekocwd/pipetap/style.css");
|
||||
Gtk.StyleContext.add_provider_for_display (Gdk.Display.get_default (),
|
||||
styling,
|
||||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
|
||||
var win = this.active_window ?? new PipeTap.Ui.MainBar (this);
|
||||
var win2 = new PipeTap.Ui.MainBar (this);
|
||||
win.present ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue