diff --git a/src/private/qstyleitem.cpp b/src/private/qstyleitem.cpp index b02b3cf9a2fc48607ca0dab6e153cc589654d1ee..b72ff40767a64a99bf4dcc79003267731464ddeb 100644 --- a/src/private/qstyleitem.cpp +++ b/src/private/qstyleitem.cpp @@ -750,7 +750,20 @@ QSize QStyleItem::sizeFromContents(int width, int height) size = qApp->style()->sizeFromContents(QStyle::CT_ProgressBar, m_styleoption, QSize(width,height)); break; case Edit: - size = qApp->style()->sizeFromContents(QStyle::CT_LineEdit, m_styleoption, QSize(width,height)); +#ifdef Q_OS_MAC + if (style() =="mac") { + if (m_hints.indexOf("small") != -1 || m_hints.indexOf("mini") != -1) + size = QSize(width, 19); + else + size = QSize(width, 21); + } else +#endif + { + size = QSize(width, height); + if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(m_styleoption)) + size += QSize(2*f->lineWidth, 2*f->lineWidth); + } + if (hints().indexOf("rounded") != -1) size += QSize(0, 3); break; diff --git a/src/styles/Desktop/TextFieldStyle.qml b/src/styles/Desktop/TextFieldStyle.qml index 5024ca861c04112579b58d56c2169d6cdf1ffe82..59af59697b1490d32f8e0572f50f1a1ec7fc6330 100644 --- a/src/styles/Desktop/TextFieldStyle.qml +++ b/src/styles/Desktop/TextFieldStyle.qml @@ -67,13 +67,14 @@ Style { property bool rounded: hints.indexOf("rounded") > -1 - property int topMargin: 1 + property int topMargin: style === "mac" ? 4 : 5 property int leftMargin: rounded ? 8 : 4 property int rightMargin: 4 property int bottomMargin: 1 contentWidth: 100 - contentHeight: 18 + // Form QLineEdit::sizeHint + contentHeight: Math.max(control.__contentHeight, 14) + topMargin + bottomMargin FocusFrame { anchors.fill: parent