- Chnage some hard-coded colors to take into account their background. (#3654)

- Change some SVGs from black to white if their background is too dark.
This commit is contained in:
Rob Blanckaert 2019-03-13 16:11:30 -07:00 committed by GitHub
parent 7eb2e36740
commit a522255baf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 10 deletions

View file

@ -57,9 +57,9 @@ PlayerListWidget::PlayerListWidget(TabSupervisor *_tabSupervisor,
readyIcon = QPixmap("theme:icons/ready_start");
notReadyIcon = QPixmap("theme:icons/not_ready_start");
concededIcon = QPixmap("theme:icons/conceded");
playerIcon = QPixmap("theme:icons/player");
judgeIcon = QPixmap("theme:icons/scales");
spectatorIcon = QPixmap("theme:icons/spectator");
playerIcon = loadColorAdjustedPixmap("theme:icons/player");
judgeIcon = loadColorAdjustedPixmap("theme:icons/scales");
spectatorIcon = loadColorAdjustedPixmap("theme:icons/spectator");
lockIcon = QPixmap("theme:icons/lock");
if (tabSupervisor) {
@ -173,8 +173,13 @@ void PlayerListWidget::setActivePlayer(int playerId)
while (i.hasNext()) {
i.next();
QTreeWidgetItem *twi = i.value();
QColor c = i.key() == playerId ? QColor(150, 255, 150) : palette().base().color();
twi->setBackground(4, c);
if (i.key() == playerId) {
twi->setBackground(4, QColor(150, 255, 150));
twi->setTextColor(4, QColor(0, 0, 0));
} else {
twi->setBackground(4, palette().base().color());
twi->setTextColor(4, palette().text().color());
}
}
}