diff options
author | Christopher Davis <christopherdavis@gnome.org> | 2021-10-08 04:05:37 -0700 |
---|---|---|
committer | Christopher Davis <christopherdavis@gnome.org> | 2021-10-08 04:38:08 -0700 |
commit | a750c1405e43ec1ec993248ba79d2160ac78955e (patch) | |
tree | 14ded059e4deaeace639fc889f9d7d02713e22df | |
parent | cba898e084c0aa039297301e3f03d9eb4bbd9c00 (diff) | |
download | baobab-a750c1405e43ec1ec993248ba79d2160ac78955e.tar.gz |
Use AdwApplication
AdwApplication automatically loads styling for us.
-rw-r--r-- | data/baobab.gresource.xml | 2 | ||||
-rw-r--r-- | data/style.css (renamed from data/baobab.css) | 0 | ||||
-rw-r--r-- | src/baobab-application.vala | 11 |
3 files changed, 4 insertions, 9 deletions
diff --git a/data/baobab.gresource.xml b/data/baobab.gresource.xml index 2f1709f..1082907 100644 --- a/data/baobab.gresource.xml +++ b/data/baobab.gresource.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <gresources> <gresource prefix="/org/gnome/baobab"> - <file compressed="true">baobab.css</file> + <file compressed="true">style.css</file> <file compressed="true">ui/baobab-excluded-row.ui</file> <file compressed="true">ui/baobab-folder-display.ui</file> <file compressed="true">ui/baobab-location-list.ui</file> diff --git a/data/baobab.css b/data/style.css index 093efb9..093efb9 100644 --- a/data/baobab.css +++ b/data/style.css diff --git a/src/baobab-application.vala b/src/baobab-application.vala index eed5846..07ac0df 100644 --- a/src/baobab-application.vala +++ b/src/baobab-application.vala @@ -22,7 +22,7 @@ namespace Baobab { - public class Application : Gtk.Application { + public class Application : Adw.Application { private Window window; @@ -75,13 +75,6 @@ namespace Baobab { protected override void startup () { base.startup (); - Adw.init (); - - // Load custom CSS - var css_provider = new Gtk.CssProvider (); - css_provider.load_from_resource ("/org/gnome/baobab/baobab.css"); - Gtk.StyleContext.add_provider_for_display (Gdk.Display.get_default (), css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); - set_accels_for_action ("win.show-home-page", { "<Alt>Left" }); set_accels_for_action ("win.show-primary-menu", { "F10" }); set_accels_for_action ("win.scan-folder", { "<Primary>o" }); @@ -102,6 +95,8 @@ namespace Baobab { public Application () { Object (application_id: "org.gnome.baobab", flags: ApplicationFlags.HANDLES_OPEN); + set_resource_base_path("/org/gnome/baobab/"); + add_main_option_entries (option_entries); set_option_context_parameter_string ("[DIRECTORY]"); |