on xenial help sign in
Simplify the Tiles.
commit9f9ab4c9371776da386350a637b3c68df2a5c683 authorMichał Sawicz <michal.sawicz@canonical.com> dateThu 3 Oct 2013, 21:10 (13 years ago) parent1c8293c
4 files changed+39−49
Components/Tile.qml+4−3 Components/TileStyle.qml+16−23 Dash/Generic/FlatTileStyle.qml+16−23 Dash/Generic/WeatherFilterGrid.qml+3
Components/Tile.qml+4−3
@@ -19,12 +19,13 @@ import Ubuntu.Components 0.1
1919
2020AbstractButton {
2121 property url source
22− property int fillMode
23− property int horizontalAlignment
24− property int verticalAlignment
22+ property int fillMode: Image.PreserveAspectCrop
23+ property int horizontalAlignment: Image.AlignHCenter
24+ property int verticalAlignment: Image.AlignVCenter
2525 property string text
2626 property int imageWidth
2727 property int imageHeight
28+ property int maximumLineCount: 1
2829
2930 style: TileStyle {}
3031}
Components/TileStyle.qml+16−23
@@ -55,33 +55,26 @@ Item {
5555 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
5656 }
5757
58− Item {
58+ Label {
59+ id: label
60+ objectName: "label"
5961 anchors {
62+ baseline: icon.bottom
63+ baselineOffset: units.gu(2)
6064 left: parent.left
6165 right: parent.right
62− top: icon.bottom
66+ leftMargin: units.gu(1)
67+ rightMargin: units.gu(1)
6368 }
64− height: units.gu(2)
6569
66− Label {
67− id: label
68− objectName: "label"
69− anchors {
70− baseline: parent.bottom
71− left: parent.left
72− right: parent.right
73− leftMargin: units.gu(1)
74− rightMargin: units.gu(1)
75− }
76−
77− color: Theme.palette.selected.backgroundText
78− opacity: 0.9
79− style: Text.Raised
80− styleColor: "black"
81− fontSize: "small"
82− elide: Text.ElideMiddle
83− horizontalAlignment: Text.AlignHCenter
84− text: styledItem.text
85− }
70+ color: Theme.palette.selected.backgroundText
71+ opacity: 0.9
72+ style: Text.Raised
73+ styleColor: "black"
74+ fontSize: "small"
75+ elide: Text.ElideMiddle
76+ horizontalAlignment: Text.AlignHCenter
77+ text: styledItem.text
78+ maximumLineCount: styledItem.maximumLineCount
8679 }
8780}
Dash/Generic/FlatTileStyle.qml+16−23
@@ -53,33 +53,26 @@ Item {
5353 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
5454 }
5555
56− Item {
56+ Label {
57+ id: label
58+ objectName: "label"
5759 anchors {
60+ baseline: icon.bottom
61+ baselineOffset: units.gu(2)
5862 left: parent.left
5963 right: parent.right
60− top: icon.bottom
64+ leftMargin: units.gu(1)
65+ rightMargin: units.gu(1)
6166 }
62− height: units.gu(2)
6367
64− Label {
65− id: label
66− objectName: "label"
67− anchors {
68− baseline: parent.bottom
69− left: parent.left
70− right: parent.right
71− leftMargin: units.gu(1)
72− rightMargin: units.gu(1)
73− }
74−
75− color: Theme.palette.selected.backgroundText
76− opacity: 0.9
77− style: Text.Raised
78− styleColor: "black"
79− fontSize: "small"
80− elide: Text.ElideMiddle
81− horizontalAlignment: Text.AlignHCenter
82− text: styledItem.text
83− }
68+ color: Theme.palette.selected.backgroundText
69+ opacity: 0.9
70+ style: Text.Raised
71+ styleColor: "black"
72+ fontSize: "small"
73+ elide: Text.ElideMiddle
74+ horizontalAlignment: Text.AlignHCenter
75+ text: styledItem.text
76+ maximumLineCount: styledItem.maximumLineCount
8477 }
8578}
Dash/Generic/WeatherFilterGrid.qml+3
@@ -21,6 +21,8 @@ import "../../Components"
2121GenericFilterGrid {
2222 id: filtergrid
2323
24+ delegateHeight: units.gu(11.5)
25+
2426 delegate: Tile {
2527 id: tile
2628 objectName: "delegate" + index
@@ -31,6 +33,7 @@ GenericFilterGrid {
3133 imageHeight: filtergrid.iconHeight
3234 source: model.icon
3335 fillMode: Image.PreserveAspectCrop
36+ maximumLineCount: 2
3437
3538 style: FlatTileStyle {}
3639