mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 17:02:15 -07:00
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:
parent
c99afe7956
commit
1fbcb69166
7 changed files with 57 additions and 99 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue