From 4644711a33538669817794e93d432f6ec906928b Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 11 Oct 2012 15:57:54 +0100 Subject: [PATCH] Fix padding to the left and right of text in a textField A TextField already had (implicit) padding to the top and bottom of the text to the frame this was added to the left and right side as matching margins look cleaner REVIEW: 106797 --- .../plasmacomponents/qml/TextField.qml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/declarativeimports/plasmacomponents/qml/TextField.qml b/declarativeimports/plasmacomponents/qml/TextField.qml index 201b61b95..be5469551 100644 --- a/declarativeimports/plasmacomponents/qml/TextField.qml +++ b/declarativeimports/plasmacomponents/qml/TextField.qml @@ -228,8 +228,8 @@ FocusScope { property alias activeFocus: textInput.activeFocus // TODO: fix default size - implicitWidth: theme.defaultFont.mSize.width*12 - implicitHeight: theme.defaultFont.mSize.height*1.6 + implicitWidth: theme.defaultFont.mSize.width*12 + base.internalPadding*2 + implicitHeight: theme.defaultFont.mSize.height + base.internalPadding*2 // TODO: needs to define if there will be specific graphics for // disabled text fields opacity: enabled ? 1.0 : 0.5 @@ -247,6 +247,7 @@ FocusScope { anchors.fill: parent imagePath: "widgets/lineedit" prefix: "base" + property real internalPadding: theme.defaultFont.mSize.height*0.3 } MouseArea { @@ -266,8 +267,8 @@ FocusScope { left: parent.left right: parent.right verticalCenter: parent.verticalCenter - leftMargin: 2 * base.margins.left - rightMargin: 2 * base.margins.right + leftMargin: base.margins.left + base.internalPadding + rightMargin: base.margins.right + base.internalPadding } text: placeholderText visible: textInput.text == "" && !textField.activeFocus @@ -295,8 +296,8 @@ FocusScope { right: parent.right verticalCenter: parent.verticalCenter // TODO: see what is the correct policy for margins - leftMargin: 2 * base.margins.left - rightMargin: 2 * base.margins.right + (clearButton.opacity > 0 ? clearButton.width : 0) + leftMargin: base.margins.left + base.internalPadding + rightMargin: base.margins.right + (clearButton.opacity > 0 ? clearButton.width : 0) + base.internalPadding } passwordCharacter: "•" selectByMouse: true