summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2015-10-22 16:24:25 (GMT)
committerAleix Pol <aleixpol@kde.org>2015-10-22 16:24:25 (GMT)
commitf22cea74d24b58b815ee345052c68424ab0fc42a (patch)
treec65aa221c3d6714e9bf8768a49b601855094635f
parent9e4b1334371203510c00cfc95ab9e551d23aff85 (diff)
Improve CategoryDisplay
Make it possible to change the sizes from outside Leave the same spacing between all items
-rw-r--r--discover/qml/ApplicationsListPage.qml2
-rw-r--r--discover/qml/ApplicationsTop.qml2
-rw-r--r--discover/qml/CategoryDisplay.qml12
3 files changed, 9 insertions, 7 deletions
diff --git a/discover/qml/ApplicationsListPage.qml b/discover/qml/ApplicationsListPage.qml
index 37a7bf2..f5ae915 100644
--- a/discover/qml/ApplicationsListPage.qml
+++ b/discover/qml/ApplicationsListPage.qml
@@ -170,6 +170,8 @@ Item {
category: page.category
width: app.actualWidth
height: implicitHeight
+ spacing: 10
+ maxtopwidth: viewLoader.sourceComponent == listComponent ? 100 : viewLoader.item.cellWidth
x: viewLoader.sourceComponent == listComponent ? page.proposedMargin : 0
}
}
diff --git a/discover/qml/ApplicationsTop.qml b/discover/qml/ApplicationsTop.qml
index a45ec03..614c1d2 100644
--- a/discover/qml/ApplicationsTop.qml
+++ b/discover/qml/ApplicationsTop.qml
@@ -34,8 +34,6 @@ ColumnLayout {
property bool extended: false
readonly property alias titleHeight: title.height
- Layout.preferredWidth: 250
-
Label {
id: title
text: topView.title
diff --git a/discover/qml/CategoryDisplay.qml b/discover/qml/CategoryDisplay.qml
index e4b91c6..cbdf052 100644
--- a/discover/qml/CategoryDisplay.qml
+++ b/discover/qml/CategoryDisplay.qml
@@ -28,6 +28,8 @@ ConditionalLoader
{
id: page
property QtObject category: null
+ property real spacing: 3
+ property real maxtopwidth: 250
CategoryModel {
id: categoryModel
@@ -38,7 +40,7 @@ ConditionalLoader
componentTrue: RowLayout {
id: gridRow
readonly property bool extended: !app.isCompact && view.count>5
- spacing: 3
+ spacing: page.spacing
ApplicationsTop {
id: top
@@ -57,9 +59,11 @@ ConditionalLoader
text: model.sortableRating.toFixed(2)
}
}
+ Layout.preferredWidth: page.maxtopwidth
}
ApplicationsTop {
id: top2
+ Layout.preferredWidth: page.maxtopwidth
Layout.fillHeight: true
Layout.fillWidth: true
sortRole: "ratingPoints"
@@ -73,10 +77,6 @@ ConditionalLoader
}
}
- Item {
- width: 4
- }
-
ColumnLayout {
Layout.fillWidth: true
Layout.fillHeight: true
@@ -90,10 +90,12 @@ ConditionalLoader
Layout.fillWidth: true
font.weight: Font.Bold
Layout.minimumHeight: paintedHeight*1.5
+ visible: view.count>0
}
CategoryView {
id: view
+ visible: view.count>0
model: categoryModel
Layout.fillWidth: true
Layout.fillHeight: true