Use enum for ThemeManager brushes

This patch introduces an enum to distinguish the different brushes that
can be set by the theme (hand, stack, etc.) and generic functions taking
the enum rather than having one copy of each function for each brush.

This is preliminary work before merging StackZone and HandZone to
simplify #4974.
This commit is contained in:
Basile Clément 2025-03-15 12:55:11 +01:00
parent c99afe7956
commit 1fbcb69166
No known key found for this signature in database
7 changed files with 57 additions and 99 deletions

View file

@ -54,12 +54,7 @@ bool TableZone::isInverted() const
void TableZone::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)
{
QBrush brush = themeManager->getTableBgBrush();
if (player->getZoneId() > 0) {
// If the extra image is not found, load the default one
brush = themeManager->getExtraTableBgBrush(QString::number(player->getZoneId()), brush);
}
QBrush brush = themeManager->getExtraBgBrush(ThemeManager::Table, player->getZoneId());
painter->fillRect(boundingRect(), brush);
if (active) {