diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml index bb2edee7..e1bac87d 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml @@ -64,8 +64,8 @@ Item { Connections { target: actionDrawer - onOpenedChanged: { - if(!actionDrawer.opened) { + function onOpenedChanged() { + if (!actionDrawer.opened) { resetSwipeView(); } } diff --git a/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml b/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml index 992ab22a..4e39e956 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml @@ -17,7 +17,6 @@ import org.kde.phone.homescreen.halcyon 1.0 as Halcyon GridView { id: root - layer.enabled: true // cache required property var searchWidget signal openConfigureRequested() diff --git a/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml b/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml index 436e6498..d4208129 100644 --- a/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml +++ b/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml @@ -20,7 +20,7 @@ import org.kde.phone.homescreen.halcyon 1.0 as Halcyon import org.kde.kirigami 2.19 as Kirigami -MobileShell.ExtendedAbstractButton { +Item { id: delegate width: GridView.view.cellWidth height: GridView.view.cellHeight @@ -39,11 +39,6 @@ MobileShell.ExtendedAbstractButton { dialogLoader.item.open(); } - cursorShape: Qt.PointingHandCursor - hoverEnabled: true - onPressAndHold: openContextMenu() - onRightClickPressed: openContextMenu() - function launchApp() { // launch app if (application.running) { @@ -53,6 +48,32 @@ MobileShell.ExtendedAbstractButton { } } + TapHandler { + id: tapHandler + acceptedButtons: Qt.LeftButton | Qt.RightButton + + // launch app handled by press animation + onTapped: (eventPoint.event.button === Qt.RightButton) ? delegate.openContextMenu() : delegate.launchAppRequested = true; + onLongPressed: delegate.openContextMenu() + + onPressedChanged: { + if (pressed) { + growAnim.stop(); + shrinkAnim.restart(); + } else if (!pressed && !shrinkAnim.running) { + growAnim.restart(); + } + } + + gesturePolicy: TapHandler.ReleaseWithinBounds + } + + HoverHandler { + id: hoverHandler + cursorShape: Qt.PointingHandCursor + acceptedPointerTypes: PointerDevice.GenericPointer | PointerDevice.Cursor | PointerDevice.Pen + } + Loader { id: dialogLoader active: false @@ -89,7 +110,7 @@ MobileShell.ExtendedAbstractButton { duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 to: MobileShell.MobileShellSettings.animationsEnabled ? 0.8 : 1 onFinished: { - if (!delegate.pressed) { + if (!tapHandler.pressed) { growAnim.restart(); } } @@ -108,17 +129,6 @@ MobileShell.ExtendedAbstractButton { } } - onPressedChanged: { - if (pressed) { - growAnim.stop(); - shrinkAnim.restart(); - } else if (!pressed && !shrinkAnim.running) { - growAnim.restart(); - } - } - // launch app handled by press animation - onClicked: launchAppRequested = true; - ColumnLayout { anchors { fill: parent @@ -154,7 +164,7 @@ MobileShell.ExtendedAbstractButton { // darken effect when hovered/pressed layer { - enabled: delegate.pressed || delegate.hovered + enabled: tapHandler.pressed || hoverHandler.hovered effect: ColorOverlay { color: Qt.rgba(0, 0, 0, 0.3) } diff --git a/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml b/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml index 56991121..03718ef7 100644 --- a/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml +++ b/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml @@ -19,7 +19,6 @@ import org.kde.phone.homescreen.halcyon 1.0 as Halcyon GridView { id: gridView - layer.enabled: true // caching readonly property int reservedSpaceForLabel: metrics.height required property real effectiveContentWidth