diff --git a/components/mobilehomescreencomponents/qml/FlickablePages.qml b/components/mobilehomescreencomponents/qml/FlickablePages.qml index 4070ddd9..3b064e4f 100644 --- a/components/mobilehomescreencomponents/qml/FlickablePages.qml +++ b/components/mobilehomescreencomponents/qml/FlickablePages.qml @@ -33,11 +33,11 @@ Flickable { property Item footer property alias dragGestureEnabled: gestureHandler.enabled - opacity: 1 - appDrawer.openFactor + opacity: appDrawer ? 1 - appDrawer.openFactor : 1 transform: Translate { - y: -mainFlickable.height/10 * appDrawer.openFactor + y: appDrawer ? -mainFlickable.height/10 * appDrawer.openFactor : 0 } - scale: (3 - appDrawer.openFactor) /3 + scale: appDrawer ? (3 - appDrawer.openFactor) /3 : 1 clip: true property bool showAddPageIndicator: false diff --git a/components/mobilehomescreencomponents/qml/private/DragGestureHandler.qml b/components/mobilehomescreencomponents/qml/private/DragGestureHandler.qml index bf9b3702..596cfa28 100644 --- a/components/mobilehomescreencomponents/qml/private/DragGestureHandler.qml +++ b/components/mobilehomescreencomponents/qml/private/DragGestureHandler.qml @@ -31,24 +31,26 @@ DragHandler { property int __scrollDirection: DragGestureHandler.None onTranslationChanged: { if (active) { - if (__scrollDirection === DragGestureHandler.None) { - if (root.appDrawer.offset > PlasmaCore.Units.gridUnit) { + if (root.appDrawer) { + if (__scrollDirection === DragGestureHandler.None) { + if (root.appDrawer.offset > PlasmaCore.Units.gridUnit) { - __scrollDirection = DragGestureHandler.Vertical; - snapPage(); - } else if (mainFlickable.contentX - __initialMainFlickableX > PlasmaCore.Units.gridUnit) { + __scrollDirection = DragGestureHandler.Vertical; + snapPage(); + } else if (mainFlickable.contentX - __initialMainFlickableX > PlasmaCore.Units.gridUnit) { - __scrollDirection = DragGestureHandler.Right; - root.appDrawer.close(); - } else if (__initialMainFlickableX - mainFlickable.contentX > PlasmaCore.Units.gridUnit) { + __scrollDirection = DragGestureHandler.Right; + root.appDrawer.close(); + } else if (__initialMainFlickableX - mainFlickable.contentX > PlasmaCore.Units.gridUnit) { - __scrollDirection = DragGestureHandler.Left; - root.appDrawer.close(); + __scrollDirection = DragGestureHandler.Left; + root.appDrawer.close(); + } } - } - if (__scrollDirection !== DragGestureHandler.Left && __scrollDirection !== DragGestureHandler.Right) { - root.appDrawer.offset = -translation.y; + if (__scrollDirection !== DragGestureHandler.Left && __scrollDirection !== DragGestureHandler.Right) { + root.appDrawer.offset = -translation.y; + } } if (__scrollDirection !== DragGestureHandler.Vertical) { let newContentX = Math.min((mainFlickable.width * mainFlickable.totalPages) - mainFlickable.width, Math.max(0, __initialMainFlickableX - translation.x)); @@ -69,7 +71,9 @@ DragHandler { if (active) { __initialMainFlickableX = mainFlickable.contentX; } else { - root.appDrawer.snapDrawerStatus(); + if (root.appDrawer) { + root.appDrawer.snapDrawerStatus(); + } if (__scrollDirection === DragGestureHandler.Left && (__initialMainFlickableX - mainFlickable.contentX > PlasmaCore.Units.gridUnit * 5)) { snapPrevPage(); } else if (__scrollDirection === DragGestureHandler.Right && (mainFlickable.contentX - __initialMainFlickableX > PlasmaCore.Units.gridUnit * 5)) {