Different backgrounds per player (#3990)

This commit is contained in:
fdipilla
2020-05-14 20:31:12 -04:00
committed by GitHub
parent 04274d2497
commit fd0620445c
3 changed files with 14 additions and 1 deletions
+8 -1
View File
@@ -55,7 +55,14 @@ bool TableZone::isInverted() const
void TableZone::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)
{
painter->fillRect(boundingRect(), themeManager->getTableBgBrush());
QBrush brush = themeManager->getTableBgBrush();
// If the player is other than Player 1
if (player->getId() > 0) {
// The player's id starts with 0 so in order to get the correct image we need to add 1
brush = themeManager->getExtraTableBgBrush(QString::number(player->getId() + 1));
}
painter->fillRect(boundingRect(), brush);
if (active) {
paintZoneOutline(painter);
+5
View File
@@ -107,3 +107,8 @@ void ThemeManager::themeChangedSlot()
emit themeChanged();
}
QBrush ThemeManager::getExtraTableBgBrush(QString extraNumber)
{
return loadBrush(TABLEZONE_BG_NAME + extraNumber, QColor(70, 50, 100));
}
+1
View File
@@ -44,6 +44,7 @@ public:
return playerBgBrush;
}
QStringMap &getAvailableThemes();
QBrush getExtraTableBgBrush(QString extraNumber);
protected slots:
void themeChangedSlot();
signals: