summaryrefslogtreecommitdiffstats
path: root/qt-ui/starwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/starwidget.cpp')
-rw-r--r--qt-ui/starwidget.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/qt-ui/starwidget.cpp b/qt-ui/starwidget.cpp
index e12692c52..fe4342b7b 100644
--- a/qt-ui/starwidget.cpp
+++ b/qt-ui/starwidget.cpp
@@ -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;
}