aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Krupenko <krnekit@gmail.com>2016-04-11 17:41:10 +0300
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-04-13 11:08:56 +0000
commit41b34b08bcae121f3613c76bda97ca23f7e44190 (patch)
treec1bd679ca6a9afa91284f3ac17c3fb7f29e41908
parent3d149697a002cbc608cc7b9242bc6d6589ae8181 (diff)
Material: correct paddings for text edit controls
Change-Id: Ie3e1808057af370f3f6a923a8a56709dd80223b8 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
-rw-r--r--src/imports/controls/material/TextArea.qml9
-rw-r--r--src/imports/controls/material/TextField.qml7
2 files changed, 9 insertions, 7 deletions
diff --git a/src/imports/controls/material/TextArea.qml b/src/imports/controls/material/TextArea.qml
index a5423727..40c8c412 100644
--- a/src/imports/controls/material/TextArea.qml
+++ b/src/imports/controls/material/TextArea.qml
@@ -44,11 +44,12 @@ T.TextArea {
implicitWidth: Math.max(contentWidth + leftPadding + rightPadding,
background ? background.implicitWidth : 0,
placeholder.implicitWidth + leftPadding + rightPadding)
- implicitHeight: Math.max(contentHeight + topPadding + bottomPadding,
+ implicitHeight: Math.max(contentHeight + 1 + topPadding + bottomPadding,
background ? background.implicitHeight : 0,
- placeholder.implicitHeight + topPadding + bottomPadding)
+ placeholder.implicitHeight + 1 + topPadding + bottomPadding)
- padding: 6
+ topPadding: 8
+ bottomPadding: 16
color: enabled ? Material.primaryTextColor : Material.hintTextColor
selectionColor: Material.accentColor
@@ -98,7 +99,7 @@ T.TextArea {
//! [background]
background: Rectangle {
- y: control.height - height
+ y: control.height - height - control.bottomPadding / 2
implicitWidth: 120
height: control.activeFocus ? 2 : 1
color: control.activeFocus ? control.Material.accentColor : control.Material.hintTextColor
diff --git a/src/imports/controls/material/TextField.qml b/src/imports/controls/material/TextField.qml
index 6a0010f7..0f929a00 100644
--- a/src/imports/controls/material/TextField.qml
+++ b/src/imports/controls/material/TextField.qml
@@ -44,9 +44,10 @@ T.TextField {
implicitWidth: Math.max(background ? background.implicitWidth : 0,
placeholder.implicitWidth + leftPadding + rightPadding)
implicitHeight: Math.max(background ? background.implicitHeight : 0,
- placeholder.implicitHeight + topPadding + bottomPadding)
+ placeholder.implicitHeight + 1 + topPadding + bottomPadding)
- padding: 6
+ topPadding: 8
+ bottomPadding: 16
color: enabled ? Material.primaryTextColor : Material.hintTextColor
selectionColor: Material.accentColor
@@ -98,7 +99,7 @@ T.TextField {
//! [background]
background: Rectangle {
- y: control.height - height
+ y: control.height - height - control.bottomPadding / 2
implicitWidth: 120
height: control.activeFocus ? 2 : 1
color: control.activeFocus ? control.Material.accentColor : control.Material.hintTextColor