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
This commit is contained in:
Malte Langkabel
2019-12-03 14:46:11 +01:00
committed by GitHub
parent 136f3b5eff
commit 00bf7ebda6
10 changed files with 52 additions and 63 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ std::string ColorScheme::getNodeTypeColor(
{
disableWarnings();
std::string type = getValue<std::string>("graph/node/" + typeStr + "/like", typeStr);
const std::string type = getValue<std::string>("graph/node/" + typeStr + "/like", typeStr);
std::string color = getValue<std::string>(
"graph/node/" + type + "/" + key + "/" + stateToString(state), "");
+5 -1
View File
@@ -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")
+1 -1
View File
@@ -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(
+1 -1
View File
@@ -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(