From ec7ea875a1947bdc165281723a925d91f81510ab Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 28 Apr 2020 16:53:52 +0200 Subject: [PATCH] Gui: [skip ci] fix size hint of QuantitySpinBox by setting text margins of 2px See https://forum.freecadweb.org/viewtopic.php?f=3&t=45344 --- src/Gui/QuantitySpinBox.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Gui/QuantitySpinBox.cpp b/src/Gui/QuantitySpinBox.cpp index 3bfd2a2db6..b64494d9b1 100644 --- a/src/Gui/QuantitySpinBox.cpp +++ b/src/Gui/QuantitySpinBox.cpp @@ -259,6 +259,8 @@ QuantitySpinBox::QuantitySpinBox(QWidget *parent) iconLabel->setStyleSheet(QString::fromLatin1("QLabel { border: none; padding: 0px; padding-top: %2px; width: %1px; height: %1px }").arg(iconHeight).arg(frameWidth/2)); iconLabel->hide(); lineEdit()->setStyleSheet(QString::fromLatin1("QLineEdit { padding-right: %1px } ").arg(iconHeight+frameWidth)); + // When a style sheet is set the text margins must for top/bottom must be set to avoid to squash the widget + lineEdit()->setTextMargins(0, 2, 0, 2); QObject::connect(iconLabel, SIGNAL(clicked()), this, SLOT(openFormulaDialog())); }