diff --git a/app/gui/AppView.qml b/app/gui/AppView.qml index af546340..5f7028ef 100644 --- a/app/gui/AppView.qml +++ b/app/gui/AppView.qml @@ -30,6 +30,18 @@ GridView { // We do this here instead of onActivated to avoid losing the user's // selection when backing out of a different page of the app. currentIndex = -1 + + // HACK: If this is not Qt 5.12 (which has synchronousDrag), + // set anchors on creation. This will cause an anchor conflict + // with the parent StackView which breaks animation, but otherwise + // the grid will not be centered in the window. + if (this.synchronousDrag === undefined) { + anchors.fill = parent + anchors.leftMargin = leftMargin + anchors.rightMargin = rightMargin + anchors.topMargin = topMargin + anchors.bottomMargin = bottomMargin + } } StackView.onActivated: { diff --git a/app/gui/PcView.qml b/app/gui/PcView.qml index 2693d8b7..14ace787 100644 --- a/app/gui/PcView.qml +++ b/app/gui/PcView.qml @@ -27,6 +27,18 @@ GridView { // We do this here instead of onActivated to avoid losing the user's // selection when backing out of a different page of the app. currentIndex = -1 + + // HACK: If this is not Qt 5.12 (which has synchronousDrag), + // set anchors on creation. This will cause an anchor conflict + // with the parent StackView which breaks animation, but otherwise + // the grid will not be centered in the window. + if (this.synchronousDrag === undefined) { + anchors.fill = parent + anchors.leftMargin = leftMargin + anchors.rightMargin = rightMargin + anchors.topMargin = topMargin + anchors.bottomMargin = bottomMargin + } } StackView.onActivated: {