Unify icon metrics

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:52 +02:00 committed by Dirk Hohndel
parent 72b256de62
commit 32ab2b34d3
9 changed files with 72 additions and 70 deletions

View file

@ -10,12 +10,23 @@
#include <QFont>
#include <QFontMetrics>
#include <QSize>
QFont defaultModelFont();
QFontMetrics defaultModelFontMetrics();
// return the default icon size, computed as the multiple of 16 closest to
// the given height (that defaults to the default font height)
int defaultIconSize(int height = defaultModelFontMetrics().height());
// Collection of icon/picture sizes and other metrics, resolution independent
struct IconMetrics {
// icon sizes
int sz_small; // ex 16px
int sz_med; // ex 24px
int sz_big; // ex 32px
// picture size
int sz_pic; // ex 128px
// icon spacing
int spacing; // ex 2px
};
const IconMetrics & defaultIconMetrics();
#endif // METRICS_H