Gui: [skip ci] try to avoid to truncate QuantitySpinBox at bottom margin on macOS

This commit is contained in:
wmayer
2020-11-08 16:07:10 +01:00
parent 8f008efc8a
commit 8e6bb060a7

View File

@@ -309,7 +309,12 @@ QuantitySpinBox::QuantitySpinBox(QWidget *parent)
iconLabel->hide();
lineEdit()->setStyleSheet(QString::fromLatin1("QLineEdit { padding-right: %1px } ").arg(iconHeight+frameWidth));
// When a style sheet is set the text margins for top/bottom must be set to avoid to squash the widget
#ifndef Q_OS_MAC
lineEdit()->setTextMargins(0, 2, 0, 2);
#else
// https://forum.freecadweb.org/viewtopic.php?f=8&t=50615
lineEdit()->setTextMargins(0, 2, 0, 4);
#endif
QObject::connect(iconLabel, SIGNAL(clicked()), this, SLOT(openFormulaDialog()));
}