diff options
author | Niels De Graef <nielsdegraef@gmail.com> | 2023-02-23 19:20:39 +0100 |
---|---|---|
committer | Niels De Graef <nielsdegraef@gmail.com> | 2023-02-23 19:24:41 +0100 |
commit | 976897f6b81ec6757709f34e5cbfc870586925e4 (patch) | |
tree | c9c4558484f3f30790dc5ece760681fe46a9fc81 /src | |
parent | 5d00cee55d2af7df3eee9af54ef8d61924a9284d (diff) | |
download | gnome-contacts-976897f6b81ec6757709f34e5cbfc870586925e4.tar.gz |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/contacts-app.vala | 9 |
1 files changed, 0 insertions, 9 deletions
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", {"<Control>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) |