diff options
| author | Aleix Pol <aleixpol@kde.org> | 2015-10-19 22:49:27 (GMT) |
|---|---|---|
| committer | Aleix Pol <aleixpol@kde.org> | 2015-10-19 22:49:27 (GMT) |
| commit | dd4367b3dda722b9e50a8d329b1b4e84dfdb771d (patch) | |
| tree | c00459c1554cf8bd2310b79a099ec3f6c5a93cdb | |
| parent | 49d6d8388b1411b28f00b79cca13f4d0762fa964 (diff) | |
Better adapt the carroussel animation to the vdg demands
| -rw-r--r-- | discover/qml/FeaturedBanner.qml | 8 | ||||
| -rw-r--r-- | discover/qml/FeaturedImage.qml | 4 | ||||
| -rw-r--r-- | discover/qml/Information.qml | 13 |
3 files changed, 16 insertions, 9 deletions
diff --git a/discover/qml/FeaturedBanner.qml b/discover/qml/FeaturedBanner.qml index eeb3b45..a7d673e 100644 --- a/discover/qml/FeaturedBanner.qml +++ b/discover/qml/FeaturedBanner.qml @@ -29,9 +29,9 @@ Information { model: FeaturedModel {} delegate: MouseArea { - property QtObject modelData: model + readonly property QtObject modelData: model + readonly property real size: PathView.itemScale enabled: modelData.package!="" - readonly property real size: PathView.isCurrentItem ? 1 : 0.7 width: 400 * size height: 250 * size @@ -42,8 +42,6 @@ Information { Qt.openUrlExternally(modelData.url) } - Behavior on width { NumberAnimation { duration: 250 } } - Behavior on height { NumberAnimation { duration: 250 } } z: PathView.isCurrentItem && !PathView.view.moving ? 1 : -1 id: itemDelegate @@ -52,7 +50,7 @@ Information { anchors.fill: parent function endsWith(str, suffix) { - return str.indexOf(suffix, str.length - str.length) !== -1; + return str.indexOf(suffix, str.length - suffix.length) !== -1; } source: endsWith(modelData.image, ".qml") ? modelData.image : "qrc:/qml/FeaturedImage.qml" diff --git a/discover/qml/FeaturedImage.qml b/discover/qml/FeaturedImage.qml index 0ace798..a7fb230 100644 --- a/discover/qml/FeaturedImage.qml +++ b/discover/qml/FeaturedImage.qml @@ -9,7 +9,7 @@ Flickable { contentWidth: Math.max(image.width, width) contentHeight: Math.max(image.height, height) property bool isCurrentItem: itemDelegate.PathView.isCurrentItem - + states: [ State { name: "shownSmall" @@ -24,7 +24,7 @@ Flickable { State { name: "shownBig" when: flick.isCurrentItem - PropertyChanges { target: flick; contentY: flick.contentHeight-flick.height } + PropertyChanges { target: flick; contentY: (flick.contentHeight-flick.height)/2 } }, State { name: "notShown" diff --git a/discover/qml/Information.qml b/discover/qml/Information.qml index 9129023..03de569 100644 --- a/discover/qml/Information.qml +++ b/discover/qml/Information.qml @@ -12,12 +12,21 @@ PathView { path: Path { startX: oriX; startY: oriY - PathLine { x: oriX-200; y: oriY } + PathAttribute { name: "itemScale"; value: 1. } + PathLine { x: oriX-500; y: oriY } PathLine { x: oriX-800; y: oriY } + PathAttribute { name: "itemScale"; value: .7 } + PathPercent { value: 0.18 } + PathLine { x: oriX-800; y: oriY-1900 } PathLine { x: oriX+800; y: oriY-1900 } + PathLine { x: oriX+800; y: oriY } - PathLine { x: oriX+200; y: oriY } + PathPercent { value: 0.82 } + PathAttribute { name: "itemScale"; value: .7 } + PathLine { x: oriX+500; y: oriY } PathLine { x: oriX; y: oriY } + PathAttribute { name: "itemScale"; value: 1 } + PathPercent { value: 1 } } function next() { incrementCurrentIndex() } |
