aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material/Switch.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/controls/material/Switch.qml')
-rw-r--r--src/imports/controls/material/Switch.qml17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/imports/controls/material/Switch.qml b/src/imports/controls/material/Switch.qml
index ca739e62..32f083f8 100644
--- a/src/imports/controls/material/Switch.qml
+++ b/src/imports/controls/material/Switch.qml
@@ -35,9 +35,9 @@
****************************************************************************/
import QtQuick 2.6
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
-import QtQuick.Templates 2.0 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
+import QtQuick.Templates 2.1 as T
T.Switch {
id: control
@@ -52,10 +52,21 @@ T.Switch {
padding: 8
spacing: 8
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
indicator: SwitchIndicator {
x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2
control: control
+
+ Ripple {
+ x: parent.handle.x + parent.handle.width / 2 - width / 2
+ y: parent.handle.y + parent.handle.height / 2 - height / 2
+ width: 28; height: 28
+ pressed: control.pressed
+ active: control.down || control.visualFocus || control.hovered
+ color: control.checked ? control.Material.highlightedRippleColor : control.Material.rippleColor
+ }
}
contentItem: Text {