Skip to content

Commit

Permalink
Improved theme naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
Dax89 committed Apr 4, 2021
1 parent 7ae1ff9 commit 5cd2698
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dialogs/analyzerdialog/analyzerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void AnalyzerDialog::getAnalyzers()
nameitem->setData(QVariant::fromValue(static_cast<void*>(const_cast<RDAnalyzer*>(a))));
nameitem->setCheckable(true);
nameitem->setCheckState(RDAnalyzer_IsSelected(a) ? Qt::Checked : Qt::Unchecked);
if(RDAnalyzer_IsExperimental(a)) nameitem->setForeground(THEME_VALUE(Theme_StateFalse));
if(RDAnalyzer_IsExperimental(a)) nameitem->setForeground(THEME_VALUE(Theme_Fail));

thethis->m_analyzersmodel->appendRow({nameitem, descritem, orderitem});
}, this);
Expand Down
5 changes: 3 additions & 2 deletions themeprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ void ThemeProvider::applyListingTheme()
{ "graph_edge", Theme_GraphEdge },
{ "graph_edge_loop", Theme_GraphEdgeLoop },
{ "graph_edge_loop_c", Theme_GraphEdgeLoopCond },
{ "state_true", Theme_StateTrue },
{ "state_false", Theme_StateFalse } };
{ "success", Theme_Success },
{ "fail", Theme_Fail },
{ "warning", Theme_Warning } };

for(auto it = m_theme.begin(); it != m_theme.end(); it++)
{
Expand Down
5 changes: 3 additions & 2 deletions themes/dark.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"graph_edge_loop": "#3498db",
"graph_edge_loop_c": "#f47cc3",

"state_true": "#2ecc71",
"state_false": "#e74c3c"
"success": "#2ecc71",
"fail": "#e74c3c",
"warning": "#ffcd02"
}
5 changes: 3 additions & 2 deletions themes/light.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"graph_edge_loop": "#297fb9",
"graph_edge_loop_c": "#8e44ad",

"state_true": "#27ae60",
"state_false": "#c0392b"
"success": "#27ae60",
"fail": "#c0392b",
"warning": "#e67e22"
}
10 changes: 5 additions & 5 deletions widgets/dashboard/analysiswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ void AnalysisWidget::updateModel(QStandardItemModel* model, const char* const* n
item->setCheckState(Qt::Checked);

if((model == m_analyzersmodel) && s->analyzersdone[i]) item->setForeground(THEME_VALUE(Theme_GraphEdgeLoop));
else item->setForeground(THEME_VALUE(Theme_StateTrue));
else item->setForeground(THEME_VALUE(Theme_Success));
}
else
{
item->setCheckState(Qt::Unchecked);

if((model == m_analyzersmodel) && s->analyzersdone[i]) item->setForeground(THEME_VALUE(Theme_GraphEdgeLoop));
else item->setForeground(THEME_VALUE(Theme_StateFalse));
else item->setForeground(THEME_VALUE(Theme_Fail));
}
}
}
Expand All @@ -99,7 +99,7 @@ void AnalysisWidget::updateStats(const RDAnalysisStatus* s)
item->setText(end.toString());

timeitem->setText(AnalysisWidget::printableDateDiff(start, end));
item->setForeground(THEME_VALUE(Theme_StateTrue));
item->setForeground(THEME_VALUE(Theme_Success));
}
else
{
Expand All @@ -123,12 +123,12 @@ void AnalysisWidget::updateDiff(QStandardItem* item, int diff)
if(diff > 0)
{
item->setText(QString("+%1").arg(diff));
item->setForeground(THEME_VALUE(Theme_StateTrue));
item->setForeground(THEME_VALUE(Theme_Success));
}
else if(diff < 0)
{
item->setText(QString("%1").arg(diff));
item->setForeground(THEME_VALUE(Theme_StateFalse));
item->setForeground(THEME_VALUE(Theme_Fail));
}
else
item->setText(QString());
Expand Down

0 comments on commit 5cd2698

Please sign in to comment.