diff --git a/src/declarativeimports/plasmastyle/TextFieldStyle.qml b/src/declarativeimports/plasmastyle/TextFieldStyle.qml index 8daaa0b83..b180a8baa 100644 --- a/src/declarativeimports/plasmastyle/TextFieldStyle.qml +++ b/src/declarativeimports/plasmastyle/TextFieldStyle.qml @@ -42,7 +42,13 @@ QtQuickControlStyle.TextFieldStyle { renderType: control.echoMode == TextInput.Normal ? Text.NativeRendering : Text.QtRendering background: Item { - implicitHeight: theme.mSize(theme.defaultFont).height * 1.6 + //QQC button heights are max(backgroundHeight, label + margins). + //QQC lineedits are only from the background (and if background is not set, just an arbirtary value of 25) + //Why? I don't know + + //In order to get the same height in both buttons and lineedits we need to apply the same rule here + + implicitHeight: Math.max(theme.mSize(theme.defaultFont).height * 1.6, theme.mSize(theme.defaultFont).height + base.margins.top + base.margins.bottom) implicitWidth: theme.mSize(theme.defaultFont).width * 12 Private.TextFieldFocus { @@ -53,8 +59,6 @@ QtQuickControlStyle.TextFieldStyle { PlasmaCore.FrameSvgItem { id: base anchors.fill: parent - // TODO: see what is the correct policy for margins - //anchors.fill: parent imagePath: "widgets/lineedit" prefix: "base" } diff --git a/tests/components/button.qml b/tests/components/button.qml index 55d7dfbe9..fdfc42d58 100644 --- a/tests/components/button.qml +++ b/tests/components/button.qml @@ -2,6 +2,7 @@ import QtQuick 2.0 import org.kde.plasma.components 2.0 as PlasmaComponents import QtQuick.Controls 1.2 +import QtQuick.Layouts 1.2 Rectangle { @@ -93,6 +94,19 @@ Rectangle } } } + + Label { + text: "button and textfield should have the same height" + } + + RowLayout { + PlasmaComponents.Button { + text: "test" + } + PlasmaComponents.TextField { + } + } + } }