summaryrefslogtreecommitdiffstats
path: root/qml/pages/LongTermPage.qml
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@digia.com>2014-03-07 15:21:49 +0100
committerCaroline Chao <caroline.chao@digia.com>2014-03-14 08:57:57 +0100
commit9ec069c5d4bfd8a3d4cca77d5a6e168f534cfed0 (patch)
tree55151e9416e18b19acadc7a7e8be1066aeb5ea58 /qml/pages/LongTermPage.qml
parentc3311b2cd83b02537b7bc019aff092d600123db5 (diff)
Refactor long term page.
The previous design makes it to cumbersome to adjust properly to strings in different languages. Now the GridLayout will take care of the column widths according to the content. Change-Id: I702c708ea58731c5a0e213f70507e7b49b621743 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'qml/pages/LongTermPage.qml')
-rw-r--r--qml/pages/LongTermPage.qml45
1 files changed, 37 insertions, 8 deletions
diff --git a/qml/pages/LongTermPage.qml b/qml/pages/LongTermPage.qml
index b659cf7..5354e64 100644
--- a/qml/pages/LongTermPage.qml
+++ b/qml/pages/LongTermPage.qml
@@ -61,16 +61,45 @@ BasicPage {
anchors.fill: parent
flickableItem.interactive: true
flickableItem.flickableDirection: Flickable.VerticalFlick
- ColumnLayout {
- id: layout
- spacing: 0
+ Item {
+ id: item
+ width: scrollview.width
+ height: grid.implicitHeight
+ property int rowHeight: 118 * ApplicationInfo.ratio
Repeater {
- id: repeat
model: cityLoaded ? ApplicationInfo.currentCityModel.daysCount() : null
- LongTermDayItem {
- Layout.fillWidth: true
- last: index === repeat.count
- onNext: nextPage()
+ Rectangle {
+ color: mouse.pressed ? ApplicationInfo.colors.smokeGray : ApplicationInfo.colors.white
+ width: scrollview.width
+ height: item.rowHeight + 1
+ y: (item.rowHeight + 1) * index
+ MouseArea {
+ id: mouse
+ anchors.fill: parent
+ onClicked: {
+ ApplicationInfo.currentIndexDay = index
+ nextPage()
+ }
+ }
+ }
+ }
+ GridLayout {
+ id: grid
+ width: scrollview.width
+ flow: GridLayout.LeftToRight
+ rowSpacing: 0
+ columnSpacing: 5 * ApplicationInfo.ratio
+ columns: r1.count && !!r1.itemAt(0) ? r1.itemAt(0).count - 1 : 0
+ Repeater {
+ id: r1
+ model: cityLoaded ? ApplicationInfo.currentCityModel.daysCount() : null
+ Repeater {
+ model: LongTermDayItem {id: longday}
+ property int dayIndex: r1.model !== null ? index : 0
+ property int last: dayIndex === r1.count
+ property var dayModel: ApplicationInfo.currentCityModel.getDayModel(dayIndex)
+ property int rowHeight: item.rowHeight
+ }
}
}
}