aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-05-02 11:34:45 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2018-05-02 12:22:15 +0000
commitfac7e9e87caf78554bc33b80fe72dc40518fcc76 (patch)
tree2fa02d844a5f8d3ab8fa0c23913614a802c0ac29 /src/imports/controls/material
parent012556df80470e294c1adaf1b442e1eb8729c598 (diff)
Add missing implicitBackground{Width|Height} to non-QQuickControls
Same as 5bd9d44b for QQuickControl. [ChangeLog][Controls][Label] Added implicitBackgroundWidth and implicitBackgroundHeight properties that can be used to simplify complex implicit size bindings. [ChangeLog][Controls][TextArea] Added implicitBackgroundWidth and implicitBackgroundHeight properties that can be used to simplify complex implicit size bindings. [ChangeLog][Controls][TextField] Added implicitBackgroundWidth and implicitBackgroundHeight properties that can be used to simplify complex implicit size bindings. Change-Id: Idcc2d9af8df086b41c15f352506fd8afdbb2e3e7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls/material')
-rw-r--r--src/imports/controls/material/TextArea.qml4
-rw-r--r--src/imports/controls/material/TextField.qml9
2 files changed, 6 insertions, 7 deletions
diff --git a/src/imports/controls/material/TextArea.qml b/src/imports/controls/material/TextArea.qml
index 7ba68017..82554b16 100644
--- a/src/imports/controls/material/TextArea.qml
+++ b/src/imports/controls/material/TextArea.qml
@@ -45,10 +45,10 @@ T.TextArea {
id: control
implicitWidth: Math.max(contentWidth + leftPadding + rightPadding,
- background ? background.implicitWidth : 0,
+ implicitBackgroundWidth,
placeholder.implicitWidth + leftPadding + rightPadding)
implicitHeight: Math.max(contentHeight + 1 + topPadding + bottomPadding,
- background ? background.implicitHeight : 0,
+ implicitBackgroundHeight,
placeholder.implicitHeight + 1 + topPadding + bottomPadding)
topPadding: 8
diff --git a/src/imports/controls/material/TextField.qml b/src/imports/controls/material/TextField.qml
index 62843774..f61c9ee8 100644
--- a/src/imports/controls/material/TextField.qml
+++ b/src/imports/controls/material/TextField.qml
@@ -44,11 +44,10 @@ import QtQuick.Controls.Material.impl 2.5
T.TextField {
id: control
- implicitWidth: Math.max(background ? background.implicitWidth : 0,
- placeholderText ? placeholder.implicitWidth + leftPadding + rightPadding : 0)
- || contentWidth + leftPadding + rightPadding
- implicitHeight: Math.max(contentHeight + topPadding + bottomPadding,
- background ? background.implicitHeight : 0,
+ implicitWidth: implicitBackgroundWidth
+ || Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding
+ implicitHeight: Math.max(implicitBackgroundHeight,
+ contentHeight + topPadding + bottomPadding,
placeholder.implicitHeight + topPadding + bottomPadding)
topPadding: 8