aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material/SwitchDelegate.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/controls/material/SwitchDelegate.qml')
-rw-r--r--src/imports/controls/material/SwitchDelegate.qml28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/imports/controls/material/SwitchDelegate.qml b/src/imports/controls/material/SwitchDelegate.qml
index 308e9772..1f1e5ffa 100644
--- a/src/imports/controls/material/SwitchDelegate.qml
+++ b/src/imports/controls/material/SwitchDelegate.qml
@@ -34,26 +34,24 @@
**
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Templates 2.4 as T
-import QtQuick.Controls 2.4
-import QtQuick.Controls.impl 2.4
-import QtQuick.Controls.Material 2.4
-import QtQuick.Controls.Material.impl 2.4
+import QtQuick 2.12
+import QtQuick.Templates 2.5 as T
+import QtQuick.Controls 2.5
+import QtQuick.Controls.impl 2.5
+import QtQuick.Controls.Material 2.5
+import QtQuick.Controls.Material.impl 2.5
T.SwitchDelegate {
id: control
- implicitWidth: Math.max(background ? background.implicitWidth : 0,
- contentItem.implicitWidth + leftPadding + rightPadding)
- implicitHeight: Math.max(background ? background.implicitHeight : 0,
- Math.max(contentItem.implicitHeight,
- indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
- baselineOffset: contentItem.y + contentItem.baselineOffset
+ implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
+ implicitContentWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
+ implicitContentHeight + topPadding + bottomPadding,
+ implicitIndicatorHeight + topPadding + bottomPadding)
padding: 16
- topPadding: 8
- bottomPadding: 8
+ verticalPadding: Material.switchDelegateVerticalPadding
spacing: 16
icon.width: 24
@@ -82,7 +80,7 @@ T.SwitchDelegate {
}
background: Rectangle {
- implicitHeight: 48
+ implicitHeight: control.Material.delegateHeight
color: control.highlighted ? control.Material.listHighlightColor : "transparent"