summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/private/qstyleitem.cpp15
-rw-r--r--src/styles/Desktop/TextFieldStyle.qml5
2 files changed, 17 insertions, 3 deletions
diff --git a/src/private/qstyleitem.cpp b/src/private/qstyleitem.cpp
index b02b3cf9a..b72ff4076 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 5024ca861..59af59697 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