diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-08-07 16:53:17 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-08-07 13:12:32 -0700 |
commit | 44f59b60222af70d913fc531ac5cd8164b36552c (patch) | |
tree | 090e69691920293be4c1813493c01a102b219304 | |
parent | fddad4e414025a76a6b3957a3c707c1253d2a67f (diff) | |
download | subsurface-44f59b60222af70d913fc531ac5cd8164b36552c.tar.gz |
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>
-rw-r--r-- | qt-ui/profile/divepixmapitem.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/qt-ui/profile/divepixmapitem.cpp b/qt-ui/profile/divepixmapitem.cpp index a73473a1f..ce5d3c404 100644 --- a/qt-ui/profile/divepixmapitem.cpp +++ b/qt-ui/profile/divepixmapitem.cpp @@ -93,7 +93,9 @@ void DivePictureItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) button->setZValue(7); 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->show(); Animations::show(button); @@ -110,13 +112,17 @@ void DivePictureItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Animations::scaleTo(this, 0.2); setZValue(0); - if(button) - button->hide(); + if(button){ + button->setParentItem(NULL); + Animations::hide(button); + } } DivePictureItem::~DivePictureItem(){ - if(button) + if(button){ + button->setParentItem(NULL); Animations::hide(button); + } } void DivePictureItem::mousePressEvent(QGraphicsSceneMouseEvent *event) |