Index: sources/gui/qml/compounds/InstructionView.qml =================================================================== diff -u -rbd01334f257c35b96b7b232beacbcd7fae60c852 -r821bf955d0ba7e028bccfee7c04ca77cf80a0bd4 --- sources/gui/qml/compounds/InstructionView.qml (.../InstructionView.qml) (revision bd01334f257c35b96b7b232beacbcd7fae60c852) +++ sources/gui/qml/compounds/InstructionView.qml (.../InstructionView.qml) (revision 821bf955d0ba7e028bccfee7c04ca77cf80a0bd4) @@ -27,19 +27,21 @@ * as the current progress in each of the pre-treatment steps. */ Rectangle { id: _root - property var stepNames : [] - property var stepImages : [] + property string location : "" + property var stepNames : [] + property var stepImages : [] property alias currentStepIndex: _swipeview.currentIndex readonly property bool isEmpty : stepNames.length == 0 && stepImages.length == 0 readonly property bool firstStep : isEmpty || _swipeview.currentIndex == 0 readonly property bool lastStep : isEmpty || _swipeview.currentIndex == _swipeview.count - 1 - readonly property int frameGap : 47 + readonly property int frameVGap : 47 + readonly property int frameHGap : frameVGap * 1.5 readonly property int chevronWidth : 25 readonly property int chevronHeight : 35 - readonly property int chevronMargin : ( _root.frameGap - _root.chevronWidth ) / 2 + readonly property int chevronMargin : ( _root.frameHGap - _root.chevronWidth ) / 2 readonly property int outerRadius : 10 readonly property int innerRadius : 5 @@ -50,44 +52,53 @@ border.color : Colors.borderButton radius : _root.outerRadius - Text { id: _message - color : Colors.textMain - text : _root.stepNames.length ? _root.stepNames[_swipeview.currentIndex] : "" - anchors.top : _root.top - anchors.bottom : _innerFrame.top - anchors.horizontalCenter: _root.horizontalCenter - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - font.pixelSize: Fonts.fontPixelDialogText - } - Rectangle { id: _innerFrame color : Colors.transparent border.color : Colors.line anchors { fill : _root - margins : _root.frameGap + leftMargin : _root.frameHGap + rightMargin : _root.frameHGap + topMargin : _root.frameVGap + bottomMargin: _root.frameVGap } radius : _root.innerRadius - Item { id: _containerSwipeView - clip : true // it has to be clipped although not performace friendly, otherwise the other pages will be partially shown. - anchors.fill : parent - SwipeView { id: _swipeview - anchors.fill: parent - Repeater { - model: _root.stepNames - Loader { id: _content - active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem - sourceComponent: Item { - Image { id: _image - width : _containerSwipeView.width - height : _containerSwipeView.height - horizontalAlignment: Image.AlignHCenter - verticalAlignment: Image.AlignVCenter - fillMode: Image.PreserveAspectFit - source: _root.stepImages[index] - } + } + + Item { id: _containerSwipeView + clip : true // it has to be clipped although not performace friendly, otherwise the other pages will be partially shown. + anchors { + right : _innerFrame.right + left : _innerFrame.left + top : _root.top + bottom : _root.bottom + } + SwipeView { id: _swipeview + anchors.fill: parent + Repeater { + model: _root.stepNames + Loader { id: _content + anchors.bottom: parent.bottom + active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem + sourceComponent: Item { + Text { id: _message + text : _root.stepNames.length ? _root.stepNames[_swipeview.currentIndex] : "" + color : Colors.textMain + width : parent.width + height : _root.frameVGap + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.pixelSize: Fonts.fontPixelDialogText } + Image { id: _image + source: _root.stepImages.length ? "file:" + _root.location + _root.stepImages[_swipeview.currentIndex] : "" + width : _innerFrame.width + height : _innerFrame.height + anchors.centerIn: parent + horizontalAlignment: Image.AlignHCenter + verticalAlignment: Image.AlignVCenter + fillMode: Image.PreserveAspectFit + } } } } @@ -127,7 +138,7 @@ MouseArea { id: _mouseAreaLeft enabled : ! _root.firstStep - width : _root.frameGap + width : _root.frameHGap anchors.left : _root.left anchors.top : _root.top anchors.bottom : _root.bottom @@ -138,7 +149,7 @@ } MouseArea {id: _mouseAreaRight enabled : ! _root.lastStep - width : _root.frameGap + width : _root.frameHGap anchors.right : _root.right anchors.top : _root.top anchors.bottom : _root.bottom