From 9812a9cc1e71b0a3d8f25c0db2457f8673e53054 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 4 Oct 2016 11:21:46 +0200 Subject: SwipeDelegate: don't emit clicked when released outside If there are no delegates and hence the mouse hasn't been grabbed, we should clear the pressed state when the mouse is dragged outside the control. We can do so by falling back to the event handling of the base class (QQuickItemDelegate) when we have no delegates. This also ensures that the canceled() signal is emitted. A similar thing is done for controls with delegates, except that only the vertical position of the mouse is checked, as we still want to initiate swipes horizontally. Change-Id: I7738f5b9e8e8b6ce4a733008fa4ff73596e854ea Task-number: QTBUG-56312 Task-number: QTBUG-57285 Reviewed-by: J-P Nurmi --- src/imports/templates/qtquicktemplates2plugin.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/imports') diff --git a/src/imports/templates/qtquicktemplates2plugin.cpp b/src/imports/templates/qtquicktemplates2plugin.cpp index 2c87fd45..e93b80c7 100644 --- a/src/imports/templates/qtquicktemplates2plugin.cpp +++ b/src/imports/templates/qtquicktemplates2plugin.cpp @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From 2e5c411c26c0c173516b61569df375d767253efd Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 23 Nov 2016 17:25:20 +0100 Subject: qquickmaterialripple_p.h: add missing qcolor.h include Task-number: QTBUG-57297 Change-Id: I6ef977700639472eb87eeceef5f9f4c008d20950 Reviewed-by: Mitch Curtis --- src/imports/controls/material/qquickmaterialripple_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/imports') diff --git a/src/imports/controls/material/qquickmaterialripple_p.h b/src/imports/controls/material/qquickmaterialripple_p.h index a1cfed94..0209ba41 100644 --- a/src/imports/controls/material/qquickmaterialripple_p.h +++ b/src/imports/controls/material/qquickmaterialripple_p.h @@ -49,6 +49,7 @@ // #include +#include QT_BEGIN_NAMESPACE -- cgit v1.2.3 From c6cfb5cf5471e54f956176b668659767a065af99 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 24 Nov 2016 11:48:47 +0100 Subject: Material: fix Drawer to respect Material.elevation Change-Id: Iecb9e44fb955ad5dc9a8ddf69b4340108693458f Reviewed-by: Mitch Curtis --- src/imports/controls/material/Drawer.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/imports') diff --git a/src/imports/controls/material/Drawer.qml b/src/imports/controls/material/Drawer.qml index a4b2e3bc..c7f4825c 100644 --- a/src/imports/controls/material/Drawer.qml +++ b/src/imports/controls/material/Drawer.qml @@ -53,12 +53,14 @@ T.Drawer { enter: Transition { SmoothedAnimation { velocity: 5 } } exit: Transition { SmoothedAnimation { velocity: 5 } } + Material.elevation: 16 + background: Rectangle { color: control.Material.dialogColor layer.enabled: control.position > 0 layer.effect: ElevationEffect { - elevation: 16 + elevation: control.Material.elevation fullHeight: true } } -- cgit v1.2.3 From ac99683595e27b4157f9fd397fefa378955e275c Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 24 Nov 2016 11:52:12 +0100 Subject: Material Drawer: show a separator line when it has no dim nor elevation This makes a non-dimmed and non-elevated Drawer stand out from the content. Other styles have such separator line always visible. Change-Id: I58a75fbcabcca09248ec4c94ec22338967fbfe87 Reviewed-by: Mitch Curtis --- src/imports/controls/material/Drawer.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/imports') diff --git a/src/imports/controls/material/Drawer.qml b/src/imports/controls/material/Drawer.qml index c7f4825c..7b401b5b 100644 --- a/src/imports/controls/material/Drawer.qml +++ b/src/imports/controls/material/Drawer.qml @@ -50,6 +50,11 @@ T.Drawer { contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + topPadding: !dim && edge === Qt.BottomEdge && Material.elevation === 0 + leftPadding: !dim && edge === Qt.RightEdge && Material.elevation === 0 + rightPadding: !dim && edge === Qt.LeftEdge && Material.elevation === 0 + bottomPadding: !dim && edge === Qt.TopEdge && Material.elevation === 0 + enter: Transition { SmoothedAnimation { velocity: 5 } } exit: Transition { SmoothedAnimation { velocity: 5 } } @@ -58,6 +63,16 @@ T.Drawer { background: Rectangle { color: control.Material.dialogColor + Rectangle { + readonly property bool horizontal: control.edge === Qt.LeftEdge || control.edge === Qt.RightEdge + width: horizontal ? 1 : parent.width + height: horizontal ? parent.height : 1 + color: control.Material.dividerColor + x: control.edge === Qt.LeftEdge ? parent.width - 1 : 0 + y: control.edge === Qt.TopEdge ? parent.height - 1 : 0 + visible: !control.dim && control.Material.elevation === 0 + } + layer.enabled: control.position > 0 layer.effect: ElevationEffect { elevation: control.Material.elevation -- cgit v1.2.3