diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2014-10-15 15:30:51 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-10-18 15:16:11 -0700 |
commit | 72b256de629c7e4ef5c52d7a9ce62ebd68a77991 (patch) | |
tree | 4d42f30596eba1c393300a6499dc5cf0e2c759e0 /qt-ui/profile | |
parent | 5a2db2db4b31b37da5661db893d60619587e5a68 (diff) | |
download | subsurface-72b256de629c7e4ef5c52d7a9ce62ebd68a77991.tar.gz |
actually use defaultIconSize()
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r-- | qt-ui/profile/divetooltipitem.cpp | 11 |
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; |