diff options
author | Quentin Rameau <quinq@fifth.space> | 2022-04-10 16:35:24 +0200 |
---|---|---|
committer | Quentin Rameau <quinq@fifth.space> | 2022-04-10 16:35:24 +0200 |
commit | 1f5b8f3bd1f37d4d3dc45d21285f34ef4752dbaa (patch) | |
tree | a04ef97de6f30054996f2ae8a4404d782b1200d8 /surf.c | |
parent | 11dca18a2d148e5a6463aba783567a3815424963 (diff) |
Add dark mode toggle
This sets dark gtk theme variant,
which should make webkit2gtk use dark css variant
from websites that provide it.
Diffstat (limited to 'surf.c')
-rw-r--r-- | surf.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -56,6 +56,7 @@ typedef enum { CaretBrowsing, Certificate, CookiePolicies, + DarkMode, DiskCache, DefaultCharset, DNSPrefetch, @@ -259,6 +260,7 @@ char *argv0; static ParamName loadtransient[] = { Certificate, CookiePolicies, + DarkMode, DiskCache, DNSPrefetch, FileURLsCrossAccess, @@ -772,6 +774,10 @@ setparameter(Client *c, int refresh, ParamName p, const Arg *a) cookiepolicy_get()); refresh = 0; break; + case DarkMode: + g_object_set(gtk_settings_get_default(), + "gtk-application-prefer-dark-theme", a->i, NULL); + break; case DiskCache: webkit_web_context_set_cache_model( webkit_web_view_get_context(c->view), a->i ? |