Fix the colors - brush wasn't being set anymore.

Also a bit of code cleanup.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-01-16 17:17:55 -02:00 committed by Dirk Hohndel
parent a6e95511a6
commit d2c5770ae1
2 changed files with 1 additions and 6 deletions

View file

@ -14,13 +14,11 @@ DiveTextItem::DiveTextItem(QGraphicsItem *parent) : QGraphicsItemGroup(parent),
internalAlignFlags(Qt::AlignHCenter | Qt::AlignVCenter), internalAlignFlags(Qt::AlignHCenter | Qt::AlignVCenter),
textBackgroundItem(new QGraphicsPathItem(this)), textBackgroundItem(new QGraphicsPathItem(this)),
textItem(new QGraphicsPathItem(this)), textItem(new QGraphicsPathItem(this)),
colorIndex(SAC_DEFAULT),
scale(1.0) scale(1.0)
{ {
setFlag(ItemIgnoresTransformations); setFlag(ItemIgnoresTransformations);
textBackgroundItem->setBrush(QBrush(getColor(TEXT_BACKGROUND))); textBackgroundItem->setBrush(QBrush(getColor(TEXT_BACKGROUND)));
textBackgroundItem->setPen(Qt::NoPen); textBackgroundItem->setPen(Qt::NoPen);
textItem->setBrush(brush);
textItem->setPen(Qt::NoPen); textItem->setPen(Qt::NoPen);
} }
@ -32,8 +30,7 @@ void DiveTextItem::setAlignment(int alignFlags)
void DiveTextItem::setBrush(const QBrush &b) void DiveTextItem::setBrush(const QBrush &b)
{ {
brush = b; textItem->setBrush(b);
updateText();
} }
void DiveTextItem::setScale(double newscale) void DiveTextItem::setScale(double newscale)

View file

@ -25,8 +25,6 @@ private:
QGraphicsPathItem *textBackgroundItem; QGraphicsPathItem *textBackgroundItem;
QGraphicsPathItem *textItem; QGraphicsPathItem *textItem;
QString internalText; QString internalText;
color_indice_t colorIndex;
QBrush brush;
double scale; double scale;
}; };