summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divetooltipitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/divetooltipitem.cpp')
-rw-r--r--qt-ui/profile/divetooltipitem.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp
index 71d987a90..fe69b56dd 100644
--- a/qt-ui/profile/divetooltipitem.cpp
+++ b/qt-ui/profile/divetooltipitem.cpp
@@ -4,6 +4,7 @@
#include "dive.h"
#include "profile.h"
#include "membuffer.h"
+#include "metrics.h"
#include <QPropertyAnimation>
#include <QGraphicsSceneMouseEvent>
#include <QPen>
@@ -138,15 +139,9 @@ ToolTipItem::ToolTipItem(QGraphicsItem *parent) : QGraphicsPathItem(parent),
timeAxis(0),
lastTime(-1)
{
- // compute icon size, by rounding the font height to the nearest multiple of
- // 16 (small), and setting medium, big and spacing proportionally
+ // set icon sizes and spacing from the default icon size
if (iconMetrics.small == -1) {
- int height = QFontMetrics(title->font()).height();
- iconMetrics.small = (height + 8)/16;
- iconMetrics.small *= 16;
- // enforce a minimum small
- if (iconMetrics.small < 16)
- iconMetrics.small = 16;
+ iconMetrics.small = defaultIconSize();
iconMetrics.medium = iconMetrics.small + iconMetrics.small/2;
iconMetrics.big = iconMetrics.small*2;
iconMetrics.spacing = iconMetrics.small/4;