mirror of
https://codeberg.org/jopejoe1/nix-conf.git
synced 2025-01-04 09:26:54 +01:00
Use local patch file
the one from the aur is not usable
This commit is contained in:
parent
2811401170
commit
8a8e1211cc
2 changed files with 56 additions and 5 deletions
|
@ -79,11 +79,7 @@
|
||||||
});
|
});
|
||||||
libadwaita = super.libadwaita.overrideAttrs (old: {
|
libadwaita = super.libadwaita.overrideAttrs (old: {
|
||||||
patches = (old.patches or []) ++ [
|
patches = (old.patches or []) ++ [
|
||||||
(super.fetchpatch {
|
./patches/adwaita-theming-support.patch
|
||||||
name = "adwaita-theming-support.diff";
|
|
||||||
url = "https://aur.archlinux.org/cgit/aur.git/plain/theming_patch.diff?h=libadwaita-without-adwaita-git";
|
|
||||||
hash = "";
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
discord = super.discord.overrideAttrs (old: {
|
discord = super.discord.overrideAttrs (old: {
|
||||||
|
|
55
patches/adwaita-theming-support.patch
Normal file
55
patches/adwaita-theming-support.patch
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
diff --git a/src/adw-style-manager.c b/src/adw-style-manager.c
|
||||||
|
index d27ebda5..f9e725d3 100644
|
||||||
|
--- a/src/adw-style-manager.c
|
||||||
|
+++ b/src/adw-style-manager.c
|
||||||
|
@@ -230,6 +230,22 @@ notify_high_contrast_cb (AdwStyleManager *self)
|
||||||
|
static void
|
||||||
|
adw_style_manager_constructed (GObject *object)
|
||||||
|
{
|
||||||
|
+adw_style_manager_theme_changed(GSettings *settings, const char *key, GdkDisplay *display)
|
||||||
|
+{
|
||||||
|
+ char *theme = g_settings_get_string(settings, "gtk-theme");
|
||||||
|
+ if (!theme) {
|
||||||
|
+ theme = "Adwaita-empty";
|
||||||
|
+ }
|
||||||
|
+ gboolean is_dark_variant = NULL != strstr(theme, "-dark");
|
||||||
|
+
|
||||||
|
+ g_object_set (gtk_settings_get_for_display (display),
|
||||||
|
+ "gtk-theme-name", theme,
|
||||||
|
+ "gtk-application-prefer-dark-theme", is_dark_variant,
|
||||||
|
+ NULL);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
AdwStyleManager *self = ADW_STYLE_MANAGER (object);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (adw_style_manager_parent_class)->constructed (object);
|
||||||
|
@@ -252,19 +268,14 @@ adw_style_manager_constructed (GObject *object)
|
||||||
|
G_CONNECT_SWAPPED);
|
||||||
|
|
||||||
|
if (!adw_is_granite_present () && !g_getenv ("GTK_THEME")) {
|
||||||
|
- g_object_set (gtk_settings_get_for_display (self->display),
|
||||||
|
- "gtk-theme-name", "Adwaita-empty",
|
||||||
|
- NULL);
|
||||||
|
-
|
||||||
|
- self->provider = gtk_css_provider_new ();
|
||||||
|
- gtk_style_context_add_provider_for_display (self->display,
|
||||||
|
- GTK_STYLE_PROVIDER (self->provider),
|
||||||
|
- GTK_STYLE_PROVIDER_PRIORITY_THEME);
|
||||||
|
-
|
||||||
|
- self->colors_provider = gtk_css_provider_new ();
|
||||||
|
- gtk_style_context_add_provider_for_display (self->display,
|
||||||
|
- GTK_STYLE_PROVIDER (self->colors_provider),
|
||||||
|
- GTK_STYLE_PROVIDER_PRIORITY_THEME);
|
||||||
|
+ GSettingsSchemaSource *schema_source =
|
||||||
|
+ g_settings_schema_source_get_default();
|
||||||
|
+ GSettingsSchema *schema = g_settings_schema_source_lookup(
|
||||||
|
+ schema_source, "org.gnome.desktop.interface", true);
|
||||||
|
+ GSettings *interface_settings = g_settings_new_full(schema, NULL, NULL);
|
||||||
|
+
|
||||||
|
+ adw_style_manager_theme_changed(interface_settings, "gtk-theme", self->display);
|
||||||
|
+ g_signal_connect (interface_settings, "changed", G_CALLBACK (adw_style_manager_theme_changed), self->display);
|
||||||
|
}
|
||||||
|
|
||||||
|
self->animations_provider = gtk_css_provider_new ();
|
Loading…
Reference in a new issue