summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-11-26 13:53:00 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-26 11:25:50 -0800
commite91a1fc26c6c0ac2efee0a13e7ab29b3caa61f0c (patch)
tree2740eada5ef554243fe2dc8e0bfe9d5579149353
parent45f716f85752d0231e0fe0fef5cf2c0a8081a379 (diff)
downloadsubsurface-e91a1fc26c6c0ac2efee0a13e7ab29b3caa61f0c.tar.gz
Fix ToolTip disappeared when resizing the ProfileWindow
When resizing the ProfileWindow and the tooltip was out of boundaries, it was really out of boundaries and there was no way to get it back ( besides re-expanding the window. ) this patch moves the tooltip to (0,0) and don't save that position, so when the window is re-expanded, it will move to the correct location again Fixes #237 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/profilegraphics.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp
index f2d8e74df..7bd00c73f 100644
--- a/qt-ui/profilegraphics.cpp
+++ b/qt-ui/profilegraphics.cpp
@@ -232,9 +232,7 @@ void ProfileGraphicsView::mouseMoveEvent(QMouseEvent* event)
return;
toolTip->refresh(&gc, mapToScene(event->pos()));
-
QPoint toolTipPos = mapFromScene(toolTip->pos());
-
scrollViewTo(event->pos());
if (zoomLevel == 0)
@@ -1569,6 +1567,9 @@ void ToolTipItem::readPos()
QPointF value = scene()->views().at(0)->mapToScene(
s.value("tooltip_position").toPoint()
);
+ if (!scene()->sceneRect().contains(value)){
+ value = QPointF(0,0);
+ }
setPos(value);
}