mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
fddad4e414
commit
44f59b6022
1 changed files with 10 additions and 4 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue