M src/application.vala => src/application.vala +12 -0
@@ 20,6 20,10 @@
namespace Oliver {
public class Application : Adw.Application {
+
+ public bool is_osx { get; set; }
+ public bool is_linux { get; set; }
+
public Application () {
Object (application_id: "net.kirgroup.Oliver", flags: ApplicationFlags.DEFAULT_FLAGS | ApplicationFlags.HANDLES_OPEN);
}
@@ 37,6 41,14 @@ namespace Oliver {
this.set_accels_for_action ("app.open", {"<primary>o"});
this.set_accels_for_action ("win.find", {"<primary>f"});
this.set_accels_for_action ("win.rescan", {"<primary>r"});
+
+ debug("name: %s", Environment.get_os_info (OsInfoKey.NAME) ?? "unk");
+ debug(" id: %s", Environment.get_os_info (OsInfoKey.ID) ?? "unk");
+ debug("vers: %s", Environment.get_os_info (OsInfoKey.VERSION) ?? "unk");
+ debug("code: %s", Environment.get_os_info (OsInfoKey.VERSION_CODENAME) ?? "unk");
+
+ this.is_osx = Environment.get_os_info (OsInfoKey.NAME) == "macOS";
+ this.is_linux = !this.is_osx;
}
public override void activate () {
M src/window.blp => src/window.blp +1 -0
@@ 21,6 21,7 @@ template $OliverWindow : Adw.ApplicationWindow {
icon-name: "open-menu-symbolic";
tooltip-text: _("Menu");
menu-model: primary_menu;
+ visible: bind template.application as <$OliverApplication> .is-linux;
}
[end]