mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Add a nice white rectangle around the picture
This makes the picture looks a bit more like a real paper picture shadow's missing, though. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e14a15e61c
commit
8e682c41e8
1 changed files with 9 additions and 0 deletions
|
@ -1,5 +1,9 @@
|
|||
#include "divepixmapitem.h"
|
||||
#include "animationfunctions.h"
|
||||
|
||||
#include <QPen>
|
||||
#include <QBrush>
|
||||
|
||||
DivePixmapItem::DivePixmapItem(QObject *parent) : QObject(parent), QGraphicsPixmapItem()
|
||||
{
|
||||
}
|
||||
|
@ -13,6 +17,11 @@ DivePictureItem::DivePictureItem(QObject *parent): DivePixmapItem(parent)
|
|||
void DivePictureItem::setPixmap(const QPixmap &pix)
|
||||
{
|
||||
DivePixmapItem::setPixmap(pix);
|
||||
QRectF r = boundingRect();
|
||||
QGraphicsRectItem *rect = new QGraphicsRectItem(0 - 10, 0 -10, r.width() + 20, r.height() + 20, this);
|
||||
rect->setPen(Qt::NoPen);
|
||||
rect->setBrush(QColor(Qt::white));
|
||||
rect->setFlag(ItemStacksBehindParent);
|
||||
setTransformOriginPoint(boundingRect().width()/2, boundingRect().height()/2);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue