actually use defaultIconSize()

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:51 +02:00 committed by Dirk Hohndel
parent 5a2db2db4b
commit 72b256de62
3 changed files with 8 additions and 21 deletions

View file

@ -1,4 +1,5 @@
#include "starwidget.h"
#include "metrics.h"
#include <QSvgRenderer>
#include <QPainter>
#include <QPaintEvent>
@ -83,14 +84,9 @@ StarWidget::StarWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f),
current(0),
readOnly(false)
{
// compute image size, by rounding the font height to the nearest multiple of 16
// set image size and spacing from the default icon size
if (imgMetrics.size == -1) {
int height = QFontMetrics(parent->font()).height();
imgMetrics.size = (height + 8)/16;
imgMetrics.size *= 16;
// enforce a minimum size
if (imgMetrics.size < 16)
imgMetrics.size = 16;
imgMetrics.size = defaultIconSize();
imgMetrics.spacing = imgMetrics.size/8;
}