Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/80SelectionModeGallery into lp:~zsombi/ubuntu-ui-toolkit/80-selection-mode

Proposed by Cris Dywan
Status: Merged
Merged at revision: 1375
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/80SelectionModeGallery
Merge into: lp:~zsombi/ubuntu-ui-toolkit/80-selection-mode
Diff against target: 71 lines (+29/-13)
2 files modified
examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml (+1/-0)
examples/ubuntu-ui-toolkit-gallery/NewListItems.qml (+28/-13)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/80SelectionModeGallery
Reviewer Review Type Date Requested Status
Zsombor Egri Pending
Review via email: mp+250036@code.launchpad.net

Commit message

Selectable list items in ListView and Column

To post a comment you must log in.
1374. By Zsombor Egri

selectable renamed to selectMode; flickering of the selection panel fixed

1375. By Cris Dywan

Demonstrate selectMode in NewListItems section

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml'
2--- examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml 2015-01-05 20:34:54 +0000
3+++ examples/ubuntu-ui-toolkit-gallery/ListItemWithLabel.qml 2015-02-18 11:17:15 +0000
4@@ -27,4 +27,5 @@
5 verticalCenter: parent.verticalCenter
6 }
7 }
8+ onPressAndHold: selectMode = !selectMode
9 }
10
11=== modified file 'examples/ubuntu-ui-toolkit-gallery/NewListItems.qml'
12--- examples/ubuntu-ui-toolkit-gallery/NewListItems.qml 2015-02-12 17:25:35 +0000
13+++ examples/ubuntu-ui-toolkit-gallery/NewListItems.qml 2015-02-18 11:17:15 +0000
14@@ -34,21 +34,37 @@
15 // clip the action delegates while swiping left/right
16 clip: true
17
18- ListItemWithLabel {
19- text: i18n.tr("Basic")
20- }
21- ListItemWithLabel {
22- text: i18n.tr("Colored divider")
23- divider {
24- colorFrom: UbuntuColors.red
25- colorTo: UbuntuColors.green
26+ ListView {
27+ height: units.gu(20)
28+ width: parent.width
29+
30+ model: [ i18n.tr("Basic"), i18n.tr("Colored divider"), i18n.tr("No divider") ]
31+ delegate: ListItemWithLabel {
32+ text: modelData
33+ divider {
34+ colorFrom: modelData == i18n.tr("Colored divider") ? UbuntuColors.red : Qt.rgba(0.0, 0.0, 0.0, 0.0)
35+ colorTo: modelData == i18n.tr("Colored divider") ? UbuntuColors.green : Qt.rgba(0.0, 0.0, 0.0, 0.0)
36+ visible: modelData != i18n.tr("No divider")
37+ }
38 }
39 }
40- ListItemWithLabel {
41- text: i18n.tr("No divider")
42- divider.visible: false
43+ }
44+
45+ TemplateSection {
46+ className: "ListItem"
47+ // no spacing between the list items in the Column
48+ spacing: 0
49+ Item {
50+ // compensate for the spacing of 0 by adding this
51+ // Item inbetween the title and the list items.
52+ height: units.gu(3)
53+ width: parent.width
54 }
55- ListItemWithLabel {
56+
57+ // clip the action delegates while swiping left/right
58+ clip: true
59+
60+ ListItemWithLabel {
61 color: UbuntuColors.blue
62 text: i18n.tr("Colored")
63 }
64@@ -56,7 +72,6 @@
65 text: i18n.tr("Highlight color")
66 highlightColor: UbuntuColors.orange
67 // no highlight without clicked() or leading/trailing actions
68- onClicked: print(i18n.tr("Highlighting list item"))
69 }
70
71 ListItemActions {

Subscribers

People subscribed via source and target branches

to all changes: