From bc7178f49d4c4331e1cdc0c973eb01400e821229 Mon Sep 17 00:00:00 2001 From: Malte Langkabel Date: Tue, 3 Dec 2019 14:46:11 +0100 Subject: [PATCH] logic: color scheme fixes (#821) * fixed issues where color scheme entries were missing * removed color scheme entries for nodes and edges that do not exist anymore --- bin/app/data/color_schemes/bad_rainbow.xml | 31 +++++++++---------- bin/app/data/color_schemes/bright.xml | 31 +++++++++---------- bin/app/data/color_schemes/dark.xml | 31 +++++++++---------- bin/app/data/gui/code_view/code_view.css | 2 +- .../custom_trail_view/custom_trail_view.css | 6 ---- .../data/gui/tooltip_view/tooltip_view.css | 2 +- src/lib/settings/ColorScheme.cpp | 2 +- src/lib_gui/qt/utility/utilityQt.cpp | 6 +++- src/lib_gui/qt/view/QtErrorView.cpp | 2 +- src/lib_gui/qt/view/QtStatusView.cpp | 2 +- 10 files changed, 52 insertions(+), 63 deletions(-) diff --git a/bin/app/data/color_schemes/bad_rainbow.xml b/bin/app/data/color_schemes/bad_rainbow.xml index e8e4868d..efa60252 100644 --- a/bin/app/data/color_schemes/bad_rainbow.xml +++ b/bin/app/data/color_schemes/bad_rainbow.xml @@ -2,6 +2,7 @@ + #494949 #CCCCCC transparent @@ -284,9 +285,6 @@ type - - type - type @@ -483,6 +481,14 @@ #797979 + + default + + + + default + + #BA5ECC @@ -496,33 +502,24 @@ #00A0B6 - - #D93D5F - - template_argument + #D93D5F - - template_argument - - template_argument + type_argument - - template_argument - #4E82F6 - #4E82F6 + include - #4E82F6 + include - #4E82F6 + include diff --git a/bin/app/data/color_schemes/bright.xml b/bin/app/data/color_schemes/bright.xml index dd049e8e..c90db38d 100644 --- a/bin/app/data/color_schemes/bright.xml +++ b/bin/app/data/color_schemes/bright.xml @@ -2,6 +2,7 @@ + white #A2A2A2 transparent @@ -276,9 +277,6 @@ type - - type - type @@ -457,6 +455,14 @@ #878787 + + default + + + + default + + #A37ACC @@ -470,33 +476,24 @@ #4B9FC4 - - #CF6B7C - - template_argument + #CF6B7C - - template_argument - - template_argument + type_argument - - template_argument - #719660 - #719660 + include - #719660 + include - #719660 + include diff --git a/bin/app/data/color_schemes/dark.xml b/bin/app/data/color_schemes/dark.xml index 488302b7..2c093a94 100644 --- a/bin/app/data/color_schemes/dark.xml +++ b/bin/app/data/color_schemes/dark.xml @@ -2,6 +2,7 @@ + #272728 #CCC transparent @@ -279,9 +280,6 @@ type - - type - type @@ -460,6 +458,14 @@ #797979 + + default + + + + default + + #8A5A94 @@ -473,33 +479,24 @@ #2D6A8C - - #C14057 - - template_argument + #C14057 - - template_argument - - template_argument + type_argument - - template_argument - #247368 - #247368 + include - #247368 + include - #247368 + include diff --git a/bin/app/data/gui/code_view/code_view.css b/bin/app/data/gui/code_view/code_view.css index 0d9ffb79..dfea9af5 100644 --- a/bin/app/data/gui/code_view/code_view.css +++ b/bin/app/data/gui/code_view/code_view.css @@ -228,7 +228,7 @@ #code_area { background-color: ; - color: ; + color: ; selection-color: ; selection-background-color: ; } diff --git a/bin/app/data/gui/custom_trail_view/custom_trail_view.css b/bin/app/data/gui/custom_trail_view/custom_trail_view.css index 5748ce51..2acb7a5c 100644 --- a/bin/app/data/gui/custom_trail_view/custom_trail_view.css +++ b/bin/app/data/gui/custom_trail_view/custom_trail_view.css @@ -53,12 +53,6 @@ color: ; } -#button:disabled, #button_small:disabled { - background: ; - border-color: ; - color: ; -} - #error { color: red; } diff --git a/bin/app/data/gui/tooltip_view/tooltip_view.css b/bin/app/data/gui/tooltip_view/tooltip_view.css index 9a1b4b46..908fff33 100644 --- a/bin/app/data/gui/tooltip_view/tooltip_view.css +++ b/bin/app/data/gui/tooltip_view/tooltip_view.css @@ -24,5 +24,5 @@ background-color: ; border-bottom: 1px solid ; padding: 3px; - color: ; + color: ; } diff --git a/src/lib/settings/ColorScheme.cpp b/src/lib/settings/ColorScheme.cpp index db8a9161..8d3a6505 100644 --- a/src/lib/settings/ColorScheme.cpp +++ b/src/lib/settings/ColorScheme.cpp @@ -41,7 +41,7 @@ std::string ColorScheme::getNodeTypeColor( { disableWarnings(); - std::string type = getValue("graph/node/" + typeStr + "/like", typeStr); + const std::string type = getValue("graph/node/" + typeStr + "/like", typeStr); std::string color = getValue( "graph/node/" + type + "/" + key + "/" + stateToString(state), ""); diff --git a/src/lib_gui/qt/utility/utilityQt.cpp b/src/lib_gui/qt/utility/utilityQt.cpp index 2a0fec78..e7368e39 100644 --- a/src/lib_gui/qt/utility/utilityQt.cpp +++ b/src/lib_gui/qt/utility/utilityQt.cpp @@ -91,7 +91,7 @@ std::string getStyleSheet(const FilePath& path) return ""; } - std::string key = seq.front(); + const std::string key = seq.front(); std::string val = seq.back(); if (key == "setting") @@ -168,6 +168,10 @@ std::string getStyleSheet(const FilePath& path) } else if (key == "color") { + if (!ColorScheme::getInstance()->hasColor(val)) + { + LOG_WARNING("Color scheme does not provide value for key \"" + val + "\" requested by style \"" + path.str() + "\"."); + } val = ColorScheme::getInstance()->getColor(val); } else if (key == "platform_wml") diff --git a/src/lib_gui/qt/view/QtErrorView.cpp b/src/lib_gui/qt/view/QtErrorView.cpp index e0baea50..bbc6e5c3 100644 --- a/src/lib_gui/qt/view/QtErrorView.cpp +++ b/src/lib_gui/qt/view/QtErrorView.cpp @@ -293,7 +293,7 @@ void QtErrorView::setStyleSheet() const { QWidget* widget = QtViewWidgetWrapper::getWidgetOfView(this); utility::setWidgetBackgroundColor( - widget, ColorScheme::getInstance()->getColor("error/background")); + widget, ColorScheme::getInstance()->getColor("window/background")); QPalette palette(m_showErrors->palette()); palette.setColor( diff --git a/src/lib_gui/qt/view/QtStatusView.cpp b/src/lib_gui/qt/view/QtStatusView.cpp index def2c2ac..f0fb2fea 100644 --- a/src/lib_gui/qt/view/QtStatusView.cpp +++ b/src/lib_gui/qt/view/QtStatusView.cpp @@ -68,7 +68,7 @@ void QtStatusView::refreshView() m_onQtThread([this]() { QWidget* widget = QtViewWidgetWrapper::getWidgetOfView(this); utility::setWidgetBackgroundColor( - widget, ColorScheme::getInstance()->getColor("error/background")); + widget, ColorScheme::getInstance()->getColor("window/background")); QPalette palette(m_showErrors->palette()); palette.setColor(