diff options
| author | Jabiertxof <jabier.arraiza@marker.es> | 2019-03-27 17:08:49 +0000 |
|---|---|---|
| committer | Jabiertxof <jabier.arraiza@marker.es> | 2019-03-27 17:08:49 +0000 |
| commit | 1ab3b2fcc1b2d3d08e4572a48b1922bf0e651cd0 (patch) | |
| tree | f165d3cfd55c9958413a38a1f302b1c7044bd86e | |
| parent | Remove dead code. (diff) | |
| download | inkscape-1ab3b2fcc1b2d3d08e4572a48b1922bf0e651cd0.tar.gz inkscape-1ab3b2fcc1b2d3d08e4572a48b1922bf0e651cd0.zip | |
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
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 9 | ||||
| -rw-r--r-- | src/widgets/desktop-widget.cpp | 8 |
2 files changed, 17 insertions, 0 deletions
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; diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index d4b52b34a..6a021312f 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -885,6 +885,7 @@ sp_desktop_widget_realize (GtkWidget *widget) { SPDesktopWidget *dtw = SP_DESKTOP_WIDGET (widget); + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); if (GTK_WIDGET_CLASS (dtw_parent_class)->realize) (* GTK_WIDGET_CLASS (dtw_parent_class)->realize) (widget); @@ -919,6 +920,13 @@ sp_desktop_widget_realize (GtkWidget *widget) window->get_style_context()->add_class("bright"); window->get_style_context()->remove_class("dark"); } + if (prefs->getBool("/theme/symbolicIcons", false)) { + window->get_style_context()->add_class("symbolic"); + window->get_style_context()->remove_class("regular"); + } else { + window->get_style_context()->add_class("regular"); + window->get_style_context()->remove_class("symbolic"); + } } } |
