diff options
| author | Aleix Pol <aleixpol@kde.org> | 2015-09-23 15:10:54 (GMT) |
|---|---|---|
| committer | Aleix Pol <aleixpol@kde.org> | 2015-09-23 15:10:54 (GMT) |
| commit | df0d102a8d0379ead526b67a75f831387ae1d79e (patch) | |
| tree | 6bce206750b27439414e4469f8f80f8cd9dc83c8 | |
| parent | 1980a87a50969c17f572f8ae28beee233f1c5e07 (diff) | |
Better match the banner's vision by the vdg
| -rw-r--r-- | discover/qml/BrowsingPage.qml | 2 | ||||
| -rw-r--r-- | discover/qml/CategoryDisplay.qml | 2 | ||||
| -rw-r--r-- | discover/qml/DefaultBanner.qml | 3 | ||||
| -rw-r--r-- | discover/qml/FeaturedBanner.qml | 96 | ||||
| -rw-r--r-- | discover/qml/FeaturedImage.qml | 1 | ||||
| -rw-r--r-- | discover/qml/Information.qml | 19 |
6 files changed, 60 insertions, 63 deletions
diff --git a/discover/qml/BrowsingPage.qml b/discover/qml/BrowsingPage.qml index a6c1bfa..f4f7e19 100644 --- a/discover/qml/BrowsingPage.qml +++ b/discover/qml/BrowsingPage.qml @@ -37,6 +37,8 @@ Item { FeaturedBanner { Layout.fillWidth: true + clip: true + anchors.horizontalCenter: parent.horizontalCenter height: 310 } diff --git a/discover/qml/CategoryDisplay.qml b/discover/qml/CategoryDisplay.qml index 4d054b1..199ec1b 100644 --- a/discover/qml/CategoryDisplay.qml +++ b/discover/qml/CategoryDisplay.qml @@ -52,6 +52,8 @@ Item GridView { id: grid anchors.fill: parent + cellWidth: 100 + cellHeight: 60 model: CategoryModel { id: categoryModel diff --git a/discover/qml/DefaultBanner.qml b/discover/qml/DefaultBanner.qml index 5e04c1b..fb2f6d7 100644 --- a/discover/qml/DefaultBanner.qml +++ b/discover/qml/DefaultBanner.qml @@ -2,8 +2,9 @@ import QtQuick 2.1 import QtQuick.Controls 1.1 import org.kde.kquickcontrolsaddons 2.0 -Item +Rectangle { + color: "white" QIconItem { id: icon icon: "kde" diff --git a/discover/qml/FeaturedBanner.qml b/discover/qml/FeaturedBanner.qml index 90f261a..3a5d967 100644 --- a/discover/qml/FeaturedBanner.qml +++ b/discover/qml/FeaturedBanner.qml @@ -31,8 +31,8 @@ Information { delegate: MouseArea { property QtObject modelData: model enabled: modelData.package!="" - width: Math.min(flick.width, info.width) - height: parent.height + width: 400 + height: 250 onClicked: { if(modelData.packageName!=null) @@ -41,71 +41,61 @@ Information { Qt.openUrlExternally(modelData.url) } - clip: true z: PathView.isCurrentItem && !PathView.view.moving ? 1 : -1 id: itemDelegate Loader { id: flick - anchors.centerIn: parent - + anchors.fill: parent + function endsWith(str, suffix) { return str.indexOf(suffix, str.length - str.length) !== -1; } - + source: endsWith(modelData.image, ".qml") ? modelData.image : "qrc:/qml/FeaturedImage.qml" - width: info.width - height: info.height + + Rectangle + { + anchors.fill: parent + color: modelData.color + border.color: "cyan" + } } - } - Rectangle { - anchors.fill: titleBar - color: palette.midlight - opacity: 0.7 - z: 20 - } + Rectangle { + anchors.fill: titleBar + color: palette.midlight + opacity: 0.7 + z: 20 + } - SystemPalette { id: palette } + SystemPalette { id: palette } - RowLayout { - id: titleBar - height: description.paintedHeight*1.2 - z: 23 - spacing: 10 - property variant modelData: info.model.get(Math.min(info.currentIndex, info.model.count)) - anchors { - left: parent.left - right: parent.right - bottom: parent.bottom - } - - ToolButton { - iconName: "go-previous" - Layout.fillHeight: true - width: height - onClicked: info.previous() - } - - QIconItem { - height: parent.height*2 - width: parent.height*2 - icon: titleBar.modelData ? titleBar.modelData.icon : "kde" - } - - Label { - id: description - Layout.fillWidth: true - anchors.verticalCenter: parent.verticalCenter + RowLayout { + id: titleBar + height: description.paintedHeight*1.2 + z: 23 + spacing: 10 + property variant modelData: info.model.get(Math.min(info.currentIndex, info.model.count)) + anchors { + left: parent.left + right: parent.right + bottom: parent.bottom + } - text: titleBar.modelData ? i18n("<b>%1</b><br/>%2", titleBar.modelData.text, titleBar.modelData.comment) : "" - } - ToolButton { - iconName: "go-next" - Layout.fillHeight: true + QIconItem { + height: parent.height + width: parent.height + icon: titleBar.modelData ? titleBar.modelData.icon : "kde" + } - width: height - onClicked: info.next() + Label { + id: description + Layout.fillWidth: true + anchors.verticalCenter: parent.verticalCenter + + text: titleBar.modelData ? i18n("<b>%1</b><br/>%2", titleBar.modelData.text, titleBar.modelData.comment) : "" + } + } } - } } diff --git a/discover/qml/FeaturedImage.qml b/discover/qml/FeaturedImage.qml index ae78dae..0ace798 100644 --- a/discover/qml/FeaturedImage.qml +++ b/discover/qml/FeaturedImage.qml @@ -3,6 +3,7 @@ import QtQuick 2.1 Flickable { id: flick + clip: true contentY: 0 interactive: false contentWidth: Math.max(image.width, width) diff --git a/discover/qml/Information.qml b/discover/qml/Information.qml index 0e9f0ca..b5cae55 100644 --- a/discover/qml/Information.qml +++ b/discover/qml/Information.qml @@ -4,20 +4,21 @@ PathView { id: viewItem interactive: false pathItemCount: count + cacheItemCount: count highlightMoveDuration: 500 - property real delWidth: width - property real delHeight: height + readonly property real oriX: viewItem.width/2 + readonly property real oriY: viewItem.height/2 property alias slideDuration: timer.interval path: Path { - startX: delWidth/2; startY: delHeight/2 - PathLine { x: 3*delWidth; y: delHeight/2 } - PathLine { x: 3*delWidth; y: -delHeight } - PathLine { x: -3*delWidth; y: -delHeight } - PathLine { x: -3*delWidth; y: delHeight/2 } - PathLine { x: delWidth/2; y: delHeight/2 } + startX: oriX; startY: oriY + PathLine { x: oriX-800; y: oriY-300 } + PathLine { x: oriX-800; y: oriY-300 } + PathLine { x: oriX+800; y: oriY-600 } + PathLine { x: oriX+800; y: oriY-300 } + PathLine { x: oriX; y: oriY } } - + function next() { incrementCurrentIndex() } function previous() { decrementCurrentIndex() } |
