Highlight current selection in Train and Trends (#4320)

Change on select bg and fg colors for Trends and Train,
currently are barely/no noticeable on Windows and macOs
when using dark colors.
---------
Co-authored-by: Alejandro Martinez <amtriathlon@gmail.com>
This commit is contained in:
vlcvboyer
2023-03-25 14:33:46 +01:00
committed by GitHub
parent e7b9275a36
commit 00d09af489

View File

@@ -635,14 +635,19 @@ GCColor::stylesheet(bool train)
// make it to order to reflect current config
QColor bgColor = train ? GColor(CTRAINPLOTBACKGROUND) : GColor(CPLOTBACKGROUND);
QColor fgColor = GCColor::invertColor(bgColor);
QColor bgSelColor = selectedColor(bgColor);
QColor fgSelColor = GCColor::invertColor(bgSelColor);
return QString("QTreeView { color: %2; background: %1; }"
"%3"
"QTableWidget { color: %2; background: %1; }"
#ifndef Q_OS_MAC
"QHeaderView { background-color: %1; color: %2; }"
"QHeaderView::section { background-color: %1; color: %2; border: 0px ; }"
#endif
"QTableWidget::item:hover { color: black; background: lightGray; }"
"QTreeView::item:hover { color: black; background: lightGray; }").arg(bgColor.name()).arg(fgColor.name());
"QTreeView::item:hover { color: black; background: lightGray; }"
"QTreeView::item:selected { color: %4; background-color: %3; }"
).arg(bgColor.name()).arg(fgColor.name()).arg(bgSelColor.name()).arg(fgSelColor.name());
}
bool