aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/basic/SwipeDelegate.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols/basic/SwipeDelegate.qml')
-rw-r--r--src/quickcontrols/basic/SwipeDelegate.qml44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/quickcontrols/basic/SwipeDelegate.qml b/src/quickcontrols/basic/SwipeDelegate.qml
new file mode 100644
index 0000000000..552f34dc01
--- /dev/null
+++ b/src/quickcontrols/basic/SwipeDelegate.qml
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Controls.impl
+import QtQuick.Templates as T
+
+T.SwipeDelegate {
+ id: control
+
+ implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
+ implicitContentWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
+ implicitContentHeight + topPadding + bottomPadding,
+ implicitIndicatorHeight + topPadding + bottomPadding)
+
+ padding: 12
+ spacing: 12
+
+ icon.width: 24
+ icon.height: 24
+ icon.color: control.palette.text
+
+ swipe.transition: Transition { SmoothedAnimation { velocity: 3; easing.type: Easing.InOutCubic } }
+
+ contentItem: IconLabel {
+ spacing: control.spacing
+ mirrored: control.mirrored
+ display: control.display
+ alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft
+
+ icon: control.icon
+ text: control.text
+ font: control.font
+ color: control.palette.text
+ }
+
+ background: Rectangle {
+ implicitWidth: 100
+ implicitHeight: 40
+ color: Color.blend(control.down ? control.palette.midlight : control.palette.light,
+ control.palette.highlight, control.visualFocus ? 0.15 : 0.0)
+ }
+}