From 976897f6b81ec6757709f34e5cbfc870586925e4 Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Thu, 23 Feb 2023 19:20:39 +0100 Subject: Automatically load our CSS Apparently `AdwApplication` automatically loads `style.css` from the GResource base path [1]. By default, that base path in a `GApplication` is the app ID (with some slight post processing). Let's use that so we can remove our custom CSS loading code. Basically, this commit moves `/org/gnome/Contacts/ui/style.css` to `/org/gnome/Contacts/style.css` to automatically use that behavior. [1]: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/styles-and-appearance.html#custom-styles --- src/contacts-app.vala | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src') diff --git a/src/contacts-app.vala b/src/contacts-app.vala index 12d2dc5..7765e40 100644 --- a/src/contacts-app.vala +++ b/src/contacts-app.vala @@ -247,7 +247,6 @@ public class Contacts.App : Adw.Application { base.startup (); - load_styling (); create_actions (); } @@ -259,14 +258,6 @@ public class Contacts.App : Adw.Application { this.set_accels_for_action ("app.quit", {"q"}); } - public void load_styling () { - var provider = new Gtk.CssProvider (); - provider.load_from_resource ("/org/gnome/Contacts/ui/style.css"); - Gtk.StyleContext.add_provider_for_display (Gdk.Display.get_default (), - provider, - Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); - } - public override void activate () { // Check if we've already done the setup process if (this.settings.did_initial_setup) -- cgit v1.2.1