This commit is contained in:
Andrei Yankovich 2020-10-10 17:34:14 +03:00
parent 499d5c3462
commit 003d49c9a9
3 changed files with 25 additions and 17 deletions

View File

@ -11,10 +11,21 @@ Page {
id: viewPort
property real globalPos: 0
anchors.fill: parent
Item {
id: viewgroundItem
anchors.right: parent.right
// anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width / 2
height: parent.height / 2
}
delegate: Component {
ViewPortGradientPage {
source: modelData
imagePos: viewPort.layer.sourceRect
viewground: viewgroundItem
// height: root.height / 3
title: "Test ViewPortPage"
text: "Test ViewPortPage. General text and <i>html code</i>"
@ -24,14 +35,7 @@ Page {
}
}
Item {
id: viewgroundItem
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width / 2
}
ScrollBar.vertical: ScrollBar {
}

View File

@ -10,7 +10,8 @@ ViewSolutionsControl {
property string source: ""
property alias imageSource: image
property rect imagePos: null
property var viewground: null
property var listView: null
property int imageMrgin: 5
@ -36,14 +37,16 @@ ViewSolutionsControl {
Flickable {
id: flickable
contentY: -(listView.contentY - delegateItem.y) + imagePos.x
contentX: -(listView.contentX - delegateItem.x) + imagePos.y
contentY: -(listView.contentY - delegateItem.y + viewground.y)
contentX: -(listView.contentX - delegateItem.x + viewground.x)
contentWidth: imagePos.width
contentHeight: imagePos.height
onContentXChanged: {
console.log(contentX)
}
contentWidth: 2000//image.width
contentHeight: image.height
clip: true
interactive: false
Image {
id: image;
source: delegateItem.source
@ -51,8 +54,9 @@ ViewSolutionsControl {
fillMode: Image.PreserveAspectFit
x:0
y:0
width: imagePos.width;
height: imagePos.height;
width: viewground.width;
height: viewground.height;
}
anchors.fill: parent

View File

@ -48,7 +48,7 @@ ViewPortPage {
gradient: Gradient {
GradientStop {
position: 0.50;
color: "#ff"+ baseColor;
color: "#0f"+ baseColor;
}
GradientStop {