diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-04-25 14:09:11 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-04-25 14:08:03 +0000 |
commit | bafe2ca913f6268829088326b86ec90b41277c36 (patch) | |
tree | 2a6ad5aa706174315614e3f6df26d7f9511078c7 /src/imports/controls/material/Button.qml | |
parent | a55ec55a13e4105fd3facdada1c2899190c52828 (diff) |
Material: use background insets
Allows easily configuring the insets from the outside. Buttons have
normally 6px insets, but for example a large Floating Action Button
doesn't.
Task-number: QTBUG-60156
Change-Id: I49121c5bd588ff83e7ab9032de42a93872e999e4
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls/material/Button.qml')
-rw-r--r-- | src/imports/controls/material/Button.qml | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/imports/controls/material/Button.qml b/src/imports/controls/material/Button.qml index eed72906..62afe2cb 100644 --- a/src/imports/controls/material/Button.qml +++ b/src/imports/controls/material/Button.qml @@ -49,7 +49,8 @@ T.Button { implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) - // external vertical padding is 6 (to increase touch area) + topInset: 6 + bottomInset: 6 padding: 12 horizontalPadding: padding - 4 spacing: 6 @@ -80,12 +81,8 @@ T.Button { // TODO: Add a proper ripple/ink effect for mouse/touch input and focus state background: Rectangle { implicitWidth: 64 - implicitHeight: control.Material.touchTarget + implicitHeight: control.Material.buttonHeight - // external vertical padding is 6 (to increase touch area) - y: 6 - width: parent.width - height: parent.height - 12 radius: 2 color: !control.enabled ? control.Material.buttonDisabledColor : control.highlighted ? control.Material.highlightedButtonColor : control.Material.buttonColor |