summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2015-10-22 15:58:11 (GMT)
committerAleix Pol <aleixpol@kde.org>2015-10-22 15:58:11 (GMT)
commit9e4b1334371203510c00cfc95ab9e551d23aff85 (patch)
tree5ea79adfcb1eabd60fe9aa58097b879f6d3085f5
parent225b85b7fa4bc7f0792949632cc85a6796523928 (diff)
Show a small title grid with "All" and the amount of items
-rw-r--r--discover/qml/ApplicationsListPage.qml6
-rw-r--r--discover/qml/AwesomeGrid.qml11
-rw-r--r--discover/qml/ScrolledAwesomeGrid.qml1
3 files changed, 15 insertions, 3 deletions
diff --git a/discover/qml/ApplicationsListPage.qml b/discover/qml/ApplicationsListPage.qml
index d169635..37a7bf2 100644
--- a/discover/qml/ApplicationsListPage.qml
+++ b/discover/qml/ApplicationsListPage.qml
@@ -224,6 +224,12 @@ Item {
header: page.header
minCellWidth: 200
+ section: RowLayout {
+ Label { text: i18n("All") }
+ Item { Layout.fillWidth: true }
+ Label { text: i18n("%1 items", theGrid.count) }
+ }
+
delegate: ApplicationsGridDelegate {
height: width/1.618 //tau
width: theGrid.cellWidth
diff --git a/discover/qml/AwesomeGrid.qml b/discover/qml/AwesomeGrid.qml
index 17f0b9d..9728bf6 100644
--- a/discover/qml/AwesomeGrid.qml
+++ b/discover/qml/AwesomeGrid.qml
@@ -21,14 +21,15 @@ import QtQuick 2.1
import QtQuick.Window 2.2
Flickable {
- property int columnCount: app.isCompact ? 1 : Math.max(Math.floor(app.actualWidth/minCellWidth), 1)
- property real cellWidth: (app.actualWidth-(columnCount-1)*dataFlow.spacing)/columnCount
+ readonly property int columnCount: app.isCompact ? 1 : Math.max(Math.floor(app.actualWidth/minCellWidth), 1)
+ readonly property real cellWidth: (app.actualWidth-(columnCount-1)*dataFlow.spacing)/columnCount
+ readonly property alias count: dataRepeater.count
property int minCellWidth: 130
property alias header: headerLoader.sourceComponent
property alias footer: footerLoader.sourceComponent
property alias delegate: dataRepeater.delegate
property alias model: dataRepeater.model
- property alias count: dataRepeater.count
+ property alias section: sectionLoader.sourceComponent
contentHeight: conts.height
Column {
@@ -40,6 +41,10 @@ Flickable {
id: headerLoader
width: parent.width
}
+ Loader {
+ id: sectionLoader
+ width: parent.width
+ }
Flow {
id: dataFlow
diff --git a/discover/qml/ScrolledAwesomeGrid.qml b/discover/qml/ScrolledAwesomeGrid.qml
index 0507e77..7db90dc 100644
--- a/discover/qml/ScrolledAwesomeGrid.qml
+++ b/discover/qml/ScrolledAwesomeGrid.qml
@@ -29,6 +29,7 @@ ScrollView {
property alias cellWidth: gridRepeater.cellWidth
property alias minCellWidth: gridRepeater.minCellWidth
property alias columnCount: gridRepeater.columnCount
+ property alias section: gridRepeater.section
AwesomeGrid {
id: gridRepeater