Dynamic ToolTipItem metrics

Instead of hard-coding the icon sizes and spacing, compute them from the
font sizes, that Qt auto-computes from the displya DPI.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Giuseppe Bilotta 2014-10-15 15:30:47 +02:00 committed by Dirk Hohndel
parent 0171368b6d
commit d8f756fe14
2 changed files with 40 additions and 21 deletions

View file

@ -27,11 +27,12 @@ public:
COLLAPSED,
EXPANDED
};
enum {
ICON_SMALL = 16,
ICON_MEDIUM = 24,
ICON_BIG = 32,
SPACING = 4
struct IconMetrics {
int small;
int medium;
int big;
int spacing;
};
explicit ToolTipItem(QGraphicsItem *parent = 0);
@ -67,6 +68,8 @@ private:
int lastTime;
QList<QGraphicsItem*> oldSelection;
static IconMetrics iconMetrics;
};
#endif // DIVETOOLTIPITEM_H