From 1ab3b2fcc1b2d3d08e4572a48b1922bf0e651cd0 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Wed, 27 Mar 2019 18:08:49 +0100 Subject: Add window class along dark/bright to mark APP is using symbolic icons or regular to allow apply diferent rules in icon contesx. For example allow use icons by css only (and sufix properly with "-symbolic" when necesary --- src/ui/dialog/inkscape-preferences.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/ui') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 1fb192869..68c664832 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -693,14 +693,23 @@ void InkscapePreferences::symbolicAddClass() // Use in case the special widgets have inverse theme background and symbolic int colorset_inverse = colorset ^ 0xffffff00; sp_svg_write_color(colornamed_inverse, sizeof(colornamed_inverse), colorset_inverse); + Gtk::Window *window = SP_ACTIVE_DESKTOP->getToplevel(); if (prefs->getBool("/theme/symbolicIcons", false)) { css_str += "*{ -gtk-icon-style: symbolic;}"; css_str += ".dark *,.bright *{ color: @theme_fg_color;}"; css_str += ".dark,.bright,.dark image,.bright image{ color:"; css_str += colornamed; css_str += ";}"; + if (window ) { + window->get_style_context()->add_class("symbolic"); + window->get_style_context()->remove_class("regular"); + } } else { css_str += "*{-gtk-icon-style: regular;}"; + if (window) { + window->get_style_context()->add_class("regular"); + window->get_style_context()->remove_class("symbolic"); + } } css_str += ".iconcolornamed, .iconcolornamed image{ color:"; css_str += colornamed; -- cgit v1.2.3