[libadwaita/wip/exalm/inspector-fixes: 5/5] style-manager: Make our own Empty theme
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/inspector-fixes: 5/5] style-manager: Make our own Empty theme
- Date: Wed, 29 Sep 2021 13:23:44 +0000 (UTC)
commit bad9233106b04f6506f529e16e0cf449305347ad
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Wed Sep 29 18:20:43 2021 +0500
style-manager: Make our own Empty theme
The GTK empty theme doesn't have a dark variant, so if an app sets
gtk-application-prefer-dark-theme=true, it can break. Make our own
Adwaita-empty theme to mitigate that.
src/adw-style-manager.c | 2 +-
src/stylesheet/adwaita-stylesheet.gresources.xml | 7 +++++++
src/stylesheet/empty.css | 0
3 files changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/adw-style-manager.c b/src/adw-style-manager.c
index 8515e89b..49530b59 100644
--- a/src/adw-style-manager.c
+++ b/src/adw-style-manager.c
@@ -248,7 +248,7 @@ adw_style_manager_constructed (GObject *object)
if (!g_getenv ("GTK_THEME")) {
g_object_set (gtk_settings_get_for_display (self->display),
- "gtk-theme-name", "Empty",
+ "gtk-theme-name", "Adwaita-empty",
NULL);
self->provider = gtk_css_provider_new ();
diff --git a/src/stylesheet/adwaita-stylesheet.gresources.xml
b/src/stylesheet/adwaita-stylesheet.gresources.xml
index 83ed9c02..e4785906 100644
--- a/src/stylesheet/adwaita-stylesheet.gresources.xml
+++ b/src/stylesheet/adwaita-stylesheet.gresources.xml
@@ -18,4 +18,11 @@
<file>assets/dash-symbolic.svg</file>
<file>assets/devel-symbolic.svg</file>
</gresource>
+
+ <gresource prefix="/org/gtk/libgtk/theme/Adwaita-empty">
+ <file alias='gtk.css'>empty.css</file>
+ <file alias='gtk-dark.css'>empty.css</file>
+ <file alias='gtk-hc.css'>empty.css</file>
+ <file alias='gtk-hc-dark.css'>empty.css</file>
+ </gresource>
</gresources>
diff --git a/src/stylesheet/empty.css b/src/stylesheet/empty.css
new file mode 100644
index 00000000..e69de29b
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]