From b2f11f494d9d9608c35f3e1622a24558f679902a Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Sun, 23 Jan 2022 06:34:37 +0100 Subject: [PATCH] :wrench: Add custom gtk style sheet --- prefs.js | 13 +++++++++++++ resources/css/gtk.css | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 resources/css/gtk.css diff --git a/prefs.js b/prefs.js index 0a25473..c8a3c7a 100644 --- a/prefs.js +++ b/prefs.js @@ -46,6 +46,19 @@ var PreferencesDialog = class PreferencesDialog { this._resources = Gio.Resource.load(Me.path + '/resources/burn-my-windows.gresource'); Gio.resources_register(this._resources); + // Load the CSS file for the settings dialog. + const styleProvider = Gtk.CssProvider.new(); + styleProvider.load_from_resource('/css/gtk.css'); + if (utils.isGTK4()) { + Gtk.StyleContext.add_provider_for_display( + Gdk.Display.get_default(), styleProvider, + Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); + } else { + Gtk.StyleContext.add_provider_for_screen( + Gdk.Screen.get_default(), styleProvider, + Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); + } + // Make sure custom icons are found. if (utils.isGTK4()) { Gtk.IconTheme.get_for_display(Gdk.Display.get_default()).add_resource_path('/img'); diff --git a/resources/css/gtk.css b/resources/css/gtk.css new file mode 100644 index 0000000..3acf2ee --- /dev/null +++ b/resources/css/gtk.css @@ -0,0 +1,3 @@ +.pill-button { + border-radius: 9999px; +} \ No newline at end of file