aboutsummaryrefslogtreecommitdiff
path: root/src/sdgui.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-10-17 09:07:30 +0200
committerPřemysl Eric Janouch <p@janouch.name>2021-10-17 09:37:32 +0200
commita31d3297542b837e65a51e0cce498da5636da228 (patch)
treec0f5bb7b944a2169ce688de7f57457d47eefca5e /src/sdgui.c
parent33e98881ad787a93cc2fc2770c1c993d5bb65081 (diff)
downloadtdv-a31d3297542b837e65a51e0cce498da5636da228.tar.gz
tdv-a31d3297542b837e65a51e0cce498da5636da228.tar.xz
tdv-a31d3297542b837e65a51e0cce498da5636da228.zip
sdgui: stop hardcoding colours
Reusing colours from sdtui configuration would be awkward and complicated, e.g. with font attributes, so abandon that idea.
Diffstat (limited to 'src/sdgui.c')
-rw-r--r--src/sdgui.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/sdgui.c b/src/sdgui.c
index b1b1329..870499c 100644
--- a/src/sdgui.c
+++ b/src/sdgui.c
@@ -246,8 +246,23 @@ main (int argc, char *argv[])
if (!load_dictionaries (g.dictionaries, &error))
die_with_dialog (error->message);
- // Some Adwaita stupidity
- const char *style = "notebook header tab { padding: 2px 8px; margin: 0; }";
+ // Some Adwaita stupidity, plus defaults for our own widget.
+ // All the named colours have been there since GNOME 3.4
+ // (see gnome-extra-themes git history, Adwaita used to live there).
+ const char *style = "notebook header tab { padding: 2px 8px; margin: 0; }"
+ "stardict-view.odd {"
+ "background: @theme_base_color; "
+ "color: @theme_text_color; }"
+ "stardict-view.odd:backdrop {"
+ "background: @theme_unfocused_base_color; "
+ "color: @theme_fg_color; /* should be more faded than 'text' */ }"
+ "stardict-view.even {"
+ "background: mix(@theme_base_color, @theme_text_color, 0.02); "
+ "color: @theme_text_color; }"
+ "stardict-view.even:backdrop {"
+ "background: mix(@theme_unfocused_base_color, "
+ "@theme_fg_color, 0.02); "
+ "color: @theme_fg_color; /* should be more faded than 'text' */ }";
GdkScreen *screen = gdk_screen_get_default ();
GtkCssProvider *provider = gtk_css_provider_new ();