From 7e1b86215bfb9fb5ef563f7ad8204d5b341bce0f Mon Sep 17 00:00:00 2001 From: Atri Bhattacharya Date: Wed, 11 Mar 2020 19:19:48 +0100 Subject: [PATCH] Prepend iconsDark path after setting default path. When the "dark theme" option is set, the iconsDark directory should be the first dir where the icon theme should search for the icon. By prepending this path after the default icons path has been set, we make sure that this dir is indeed the first in the list of dirs to look up icons. Fixes issue #1746. --- src/control/XournalMain.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/control/XournalMain.cpp b/src/control/XournalMain.cpp index b996b5c0..9609db72 100644 --- a/src/control/XournalMain.cpp +++ b/src/control/XournalMain.cpp @@ -319,13 +319,14 @@ auto XournalMain::run(int argc, char* argv[]) -> int { auto* control = new Control(gladePath); + string icon = gladePath->getFirstSearchPath() + "/icons/"; + gtk_icon_theme_prepend_search_path(gtk_icon_theme_get_default(), icon.c_str()); + if (control->getSettings()->isDarkTheme()) { string icon = gladePath->getFirstSearchPath() + "/iconsDark/"; gtk_icon_theme_prepend_search_path(gtk_icon_theme_get_default(), icon.c_str()); - } - string icon = gladePath->getFirstSearchPath() + "/icons/"; - gtk_icon_theme_prepend_search_path(gtk_icon_theme_get_default(), icon.c_str()); + } auto* win = new MainWindow(gladePath, control); control->initWindow(win);