From 41b34b08bcae121f3613c76bda97ca23f7e44190 Mon Sep 17 00:00:00 2001 From: Nikita Krupenko Date: Mon, 11 Apr 2016 17:41:10 +0300 Subject: Material: correct paddings for text edit controls Change-Id: Ie3e1808057af370f3f6a923a8a56709dd80223b8 Reviewed-by: J-P Nurmi --- src/imports/controls/material/TextArea.qml | 9 +++++---- src/imports/controls/material/TextField.qml | 7 ++++--- 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 -- cgit v1.2.3