mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Merge branch 'master' into Refactor-settings
Conflicts: oracle/CMakeLists.txt
This commit is contained in:
commit
baa61d0571
330 changed files with 37514 additions and 13448 deletions
|
|
@ -15,6 +15,7 @@
|
|||
#include "tab_game.h"
|
||||
#include "gamescene.h"
|
||||
#include "settingscache.h"
|
||||
#include "thememanager.h"
|
||||
#include "dlg_create_token.h"
|
||||
#include "carddatabase.h"
|
||||
#include "color.h"
|
||||
|
|
@ -68,25 +69,18 @@ PlayerArea::PlayerArea(QGraphicsItem *parentItem)
|
|||
: QObject(), QGraphicsItem(parentItem)
|
||||
{
|
||||
setCacheMode(DeviceCoordinateCache);
|
||||
connect(settingsCache, SIGNAL(playerBgPathChanged()), this, SLOT(updateBgPixmap()));
|
||||
updateBgPixmap();
|
||||
connect(themeManager, SIGNAL(themeChanged()), this, SLOT(updateBg()));
|
||||
updateBg();
|
||||
}
|
||||
|
||||
void PlayerArea::updateBgPixmap()
|
||||
void PlayerArea::updateBg()
|
||||
{
|
||||
QString bgPath = settingsCache->getPlayerBgPath();
|
||||
if (bgPath.isEmpty())
|
||||
bgPixmapBrush = QBrush(QColor(200, 200, 200));
|
||||
else {
|
||||
qDebug() << "loading" << bgPath;
|
||||
bgPixmapBrush = QBrush(QPixmap(bgPath));
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
void PlayerArea::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)
|
||||
{
|
||||
painter->fillRect(bRect, bgPixmapBrush);
|
||||
painter->fillRect(bRect, themeManager->getPlayerBgBrush());
|
||||
}
|
||||
|
||||
void PlayerArea::setSize(qreal width, qreal height)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue