mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
5a2db2db4b
commit
72b256de62
3 changed files with 8 additions and 21 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue