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/RoundButton.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/RoundButton.qml')
-rw-r--r-- | src/imports/controls/material/RoundButton.qml | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/imports/controls/material/RoundButton.qml b/src/imports/controls/material/RoundButton.qml index e243ae72..fafc92c7 100644 --- a/src/imports/controls/material/RoundButton.qml +++ b/src/imports/controls/material/RoundButton.qml @@ -49,7 +49,10 @@ T.RoundButton { implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) - // external vertical padding is 6 (to increase touch area) + topInset: 6 + leftInset: 6 + rightInset: 6 + bottomInset: 6 padding: 12 spacing: 6 @@ -78,14 +81,9 @@ T.RoundButton { // TODO: Add a proper ripple/ink effect for mouse/touch input and focus state background: Rectangle { - implicitWidth: control.Material.touchTarget - implicitHeight: control.Material.touchTarget + implicitWidth: control.Material.buttonHeight + implicitHeight: control.Material.buttonHeight - // external vertical padding is 6 (to increase touch area) - x: 6 - y: 6 - width: parent.width - 12 - height: parent.height - 12 radius: control.radius color: !control.enabled ? control.Material.buttonDisabledColor : control.checked || control.highlighted ? control.Material.highlightedButtonColor : control.Material.buttonColor |