Move the Trash bin to the topRight on the pictures

It was too easy to remove a picture by mistake, not anymore.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-08-07 16:53:17 -03:00 committed by Dirk Hohndel
parent fddad4e414
commit 44f59b6022

View file

@ -93,7 +93,9 @@ void DivePictureItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
button->setZValue(7); button->setZValue(7);
scene()->addItem(button); scene()->addItem(button);
} }
button->setPos(mapToScene(0,0)); button->setParentItem(this);
button->setPos(boundingRect().width() - button->boundingRect().width() * 0.2,
boundingRect().height() - button->boundingRect().height() * 0.2);
button->setOpacity(0); button->setOpacity(0);
button->show(); button->show();
Animations::show(button); Animations::show(button);
@ -110,13 +112,17 @@ void DivePictureItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{ {
Animations::scaleTo(this, 0.2); Animations::scaleTo(this, 0.2);
setZValue(0); setZValue(0);
if(button) if(button){
button->hide(); button->setParentItem(NULL);
Animations::hide(button);
}
} }
DivePictureItem::~DivePictureItem(){ DivePictureItem::~DivePictureItem(){
if(button) if(button){
button->setParentItem(NULL);
Animations::hide(button); Animations::hide(button);
}
} }
void DivePictureItem::mousePressEvent(QGraphicsSceneMouseEvent *event) void DivePictureItem::mousePressEvent(QGraphicsSceneMouseEvent *event)