Theme manager

This is the first implementation of a theme manager. It’s a rebased and
revisited version of #792.
This commit is contained in:
Fabio Bas 2015-05-17 23:30:14 +02:00
parent 48c3e64ef5
commit 6b8ebe54e9
64 changed files with 360 additions and 388 deletions

View file

@ -5,6 +5,7 @@
#include "decklist.h"
#include "carddatabase.h"
#include "settingscache.h"
#include "thememanager.h"
#include "main.h"
DeckViewCardDragItem::DeckViewCardDragItem(DeckViewCard *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag)
@ -128,10 +129,6 @@ void DeckViewCard::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
DeckViewCardContainer::DeckViewCardContainer(const QString &_name)
: QGraphicsItem(), name(_name), width(0), height(0)
{
QString bgPath = settingsCache->getTableBgPath();
if (!bgPath.isEmpty())
bgPixmap.load(bgPath);
setCacheMode(DeviceCoordinateCache);
}
@ -144,17 +141,7 @@ void DeckViewCardContainer::paint(QPainter *painter, const QStyleOptionGraphicsI
{
qreal totalTextWidth = getCardTypeTextWidth();
if (bgPixmap.isNull()) {
QLinearGradient grad1(0, 0, 1, 0);
grad1.setCoordinateMode(QGradient::ObjectBoundingMode);
grad1.setColorAt(0, QColor(30, 30, 30));
grad1.setColorAt(1, QColor(80, 80, 80));
painter->fillRect(QRectF(0, 0, width, height), QBrush(grad1));
painter->fillRect(boundingRect(), QColor(0, 0, 0, 80));
}
else
painter->fillRect(boundingRect(), QBrush(bgPixmap));
painter->fillRect(boundingRect(), themeManager->getTableBgBrush());
painter->setPen(QColor(255, 255, 255, 100));
painter->drawLine(QPointF(0, separatorY), QPointF(width, separatorY));