diff --git a/src/controls/OverlayDrawer.qml b/src/controls/OverlayDrawer.qml --- a/src/controls/OverlayDrawer.qml +++ b/src/controls/OverlayDrawer.qml @@ -102,6 +102,11 @@ width: height height: Units.iconSizes.smallMedium source: root.edge == Qt.LeftEdge ? Qt.resolvedUrl("templates/private/MenuIcon.qml") : (root.edge == Qt.RightEdge ? Qt.resolvedUrl("templates/private/ContextIcon.qml") : "") + onItemChanged: { + if(item) { + item.morph = Qt.binding(function(){return root.position}) + } + } } } diff --git a/src/controls/Page.qml b/src/controls/Page.qml --- a/src/controls/Page.qml +++ b/src/controls/Page.qml @@ -273,7 +273,7 @@ bottom: parent.bottom } height: item ? item.height : 0 - source: applicationWindow().header.toString().indexOf("ToolBarApplicationHeader") !== 0 ? Qt.resolvedUrl("./private/ActionButton.qml") : "" + source: applicationWindow().header && applicationWindow().header.toString().indexOf("ToolBarApplicationHeader") !== 0 ? Qt.resolvedUrl("./private/ActionButton.qml") : "" } Layout.fillWidth: true diff --git a/src/controls/templates/ApplicationHeader.qml b/src/controls/templates/ApplicationHeader.qml --- a/src/controls/templates/ApplicationHeader.qml +++ b/src/controls/templates/ApplicationHeader.qml @@ -149,7 +149,7 @@ width: { //more columns shown? - if (__appWindow.wideScreen) { + if (__appWindow.wideScreen && page) { if (modelData == 0 && titleList.backButton) { return page.width - Math.max(0, titleList.backButton.width - __appWindow.contentItem.x); } else { diff --git a/src/controls/templates/private/ContextIcon.qml b/src/controls/templates/private/ContextIcon.qml --- a/src/controls/templates/private/ContextIcon.qml +++ b/src/controls/templates/private/ContextIcon.qml @@ -26,7 +26,7 @@ id: canvas width: height height: Units.iconSizes.smallMedium - property real morph: root.position + property real morph: 0 property color color: Theme.textColor opacity: 0.8 layer.enabled: true diff --git a/src/controls/templates/private/MenuIcon.qml b/src/controls/templates/private/MenuIcon.qml --- a/src/controls/templates/private/MenuIcon.qml +++ b/src/controls/templates/private/MenuIcon.qml @@ -26,7 +26,7 @@ id: canvas width: height height: Units.iconSizes.smallMedium - property real morph: root.position + property real morph: 0 property color color: Theme.textColor opacity: 0.8 layer.enabled: true diff --git a/src/controls/templates/private/PageRow.qml b/src/controls/templates/private/PageRow.qml --- a/src/controls/templates/private/PageRow.qml +++ b/src/controls/templates/private/PageRow.qml @@ -309,7 +309,10 @@ boundsBehavior: Flickable.StopAtBounds contentWidth: mainLayout.childrenRect.width contentHeight: height - readonly property Item currentItem: pagesLogic.get(Math.min(currentIndex, pagesLogic.count-1)).page + readonly property Item currentItem: { + var idx = Math.min(currentIndex, pagesLogic.count-1) + return idx>=0 ? pagesLogic.get(idx).page : null + } //clip only when the app has a sidebar clip: root.x > 0 @@ -320,7 +323,7 @@ onCurrentItemChanged: { var itemX = pagesLogic.roundedDefaultColumnWidth * currentIndex; - if (itemX >= contentX && itemX + mainFlickable.currentItem.width <= contentX + mainFlickable.width) { + if (itemX >= contentX && mainFlickable.currentItem && itemX + mainFlickable.currentItem.width <= contentX + mainFlickable.width) { return; } @@ -330,7 +333,7 @@ } scrollAnim.running = false; scrollAnim.from = contentX; - if (itemX < contentX) { + if (itemX < contentX || !mainFlickable.currentItem) { scrollAnim.to = Math.max(0, Math.min(itemX, mainFlickable.contentWidth - mainFlickable.width)); } else { scrollAnim.to = Math.max(0, Math.min(itemX - mainFlickable.width + mainFlickable.currentItem.width, mainFlickable.contentWidth - mainFlickable.width)); diff --git a/src/styles/Desktop/OverlayDrawer.qml b/src/styles/Desktop/OverlayDrawer.qml --- a/src/styles/Desktop/OverlayDrawer.qml +++ b/src/styles/Desktop/OverlayDrawer.qml @@ -81,6 +81,11 @@ width: height height: Units.iconSizes.smallMedium - Units.smallSpacing * 2 source: root.edge == Qt.LeftEdge ? Qt.resolvedUrl("../../templates/private/MenuIcon.qml") : (root.edge == Qt.RightEdge ? Qt.resolvedUrl("../../templates/private/ContextIcon.qml") : "") + onItemChanged: { + if(item) { + item.morph = Qt.binding(function(){return root.position}) + } + } } Rectangle { anchors {