Merge lp:~zsombi/ubuntu-ui-toolkit/40-visualize-options into lp:~bzoltan/ubuntu-ui-toolkit/new_list_item

Proposed by Zsombor Egri
Status: Superseded
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/40-visualize-options
Merge into: lp:~bzoltan/ubuntu-ui-toolkit/new_list_item
Prerequisite: lp:~zsombi/ubuntu-ui-toolkit/35-options-panel-swipe
Diff against target: 153 lines (+83/-10)
3 files modified
modules/Ubuntu/Components/ListItemPanel.qml (+56/-2)
tests/resources/listitems/ListItemTest.qml (+17/-4)
tests/unit_x11/tst_components/tst_listitem.qml (+10/-4)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/40-visualize-options
Reviewer Review Type Date Requested Status
Ubuntu SDK team Pending
Review via email: mp+234635@code.launchpad.net

Commit message

ListItemOptions visualisation.

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

prereq

1242. By Zsombor Egri

prereq

1243. By Zsombor Egri

icon color for trailing panel

1244. By Zsombor Egri

prereq

1245. By Zsombor Egri

prereq merge

1246. By Zsombor Egri

fix visible

1247. By Zsombor Egri

prereq

1248. By Zsombor Egri

prereq

1249. By Zsombor Egri

add more options to test app

1250. By Zsombor Egri

prereq

1251. By Zsombor Egri

options fixed

1252. By Zsombor Egri

prereq

1253. By Zsombor Egri

document restrictions when used with Flickables

1254. By Zsombor Egri

prereq

1255. By Zsombor Egri

actions transfer fix

1256. By Zsombor Egri

prereq sync

1257. By Zsombor Egri

prereq sync

1258. By Zsombor Egri

prereq sync

1259. By Zsombor Egri

prereq sync

1260. By Zsombor Egri

prereq sync

1261. By Zsombor Egri

prereq sync

1262. By Zsombor Egri

prereq sync

1263. By Zsombor Egri

prereq sync

1264. By Zsombor Egri

prereq sync

1265. By Zsombor Egri

prereq sync

1266. By Zsombor Egri

prereq sync

1267. By Zsombor Egri

prereq sync

1268. By Zsombor Egri

prereq sync

1269. By Zsombor Egri

disabled actions are shown 50% dimmed

1270. By Zsombor Egri

prereq sync

1271. By Zsombor Egri

prereq sync

1272. By Zsombor Egri

fixing panel and test app due to prereq changes

1273. By Zsombor Egri

small fixes

1274. By Zsombor Egri

prereq sync

1275. By Zsombor Egri

prereq sync

1276. By Zsombor Egri

test fixed

1277. By Zsombor Egri

prereq sync

1278. By Zsombor Egri

prereq sync

1279. By Zsombor Egri

tests added

1280. By Zsombor Egri

API updated

1281. By Zsombor Egri

prereq sync

1282. By Zsombor Egri

prereq sync

1283. By Zsombor Egri

use correct signal to forward children changes

1284. By Zsombor Egri

prereq sync

1285. By Zsombor Egri

prereq sync

1286. By Zsombor Egri

prereq sync

1287. By Zsombor Egri

prereq sync

1288. By Zsombor Egri

ListItemPanel fixes

1289. By Zsombor Egri

highlight when pressed

1290. By Zsombor Egri

highlight fix

1291. By Zsombor Egri

highlight fix

1292. By Zsombor Egri

revert UCStyledItemBase changes from rev 1290 so we do not forward child mouse events as normal mouse events, as we can get loads of similar mouse events (i.e. press events) on ListItem when a child is pressed. Instead handle mouse events in child filter

1293. By Zsombor Egri

calling super-class method

Unmerged revisions

1293. By Zsombor Egri

calling super-class method

1292. By Zsombor Egri

revert UCStyledItemBase changes from rev 1290 so we do not forward child mouse events as normal mouse events, as we can get loads of similar mouse events (i.e. press events) on ListItem when a child is pressed. Instead handle mouse events in child filter

1291. By Zsombor Egri

highlight fix

1290. By Zsombor Egri

highlight fix

1289. By Zsombor Egri

highlight when pressed

1288. By Zsombor Egri

ListItemPanel fixes

1287. By Zsombor Egri

prereq sync

1286. By Zsombor Egri

prereq sync

1285. By Zsombor Egri

prereq sync

1284. By Zsombor Egri

prereq sync

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'modules/Ubuntu/Components/ListItemPanel.qml'
--- modules/Ubuntu/Components/ListItemPanel.qml 2014-09-15 08:41:36 +0000
+++ modules/Ubuntu/Components/ListItemPanel.qml 2014-09-15 08:41:37 +0000
@@ -22,7 +22,7 @@
22 */22 */
23Item {23Item {
24 id: panel24 id: panel
25 width: units.gu(20)25 width: optionsRow.childrenRect.width
2626
27 readonly property Item contentItem: parent ? parent.contentItem : null27 readonly property Item contentItem: parent ? parent.contentItem : null
28 /*28 /*
@@ -48,6 +48,60 @@
4848
49 Rectangle {49 Rectangle {
50 anchors.fill: parent50 anchors.fill: parent
51 color: leadingPanel ? UbuntuColors.red : UbuntuColors.green51 // FIXME: use Palette colors instead when available
52 color: leadingPanel ? UbuntuColors.red : "#00000000"
53 }
54
55 Row {
56 id: optionsRow
57 anchors {
58 left: parent.left
59 top: parent.top
60 bottom: parent.bottom
61 leftMargin: spacing
62 }
63
64 property real maxItemWidth: panel.parent ? (panel.parent.width / panel.optionList.length) : 0
65
66 Repeater {
67 model: panel.optionList
68 AbstractButton {
69 action: modelData
70 width: (!visible || !enabled) ?
71 0 : MathUtils.clamp(delegateLoader.item ? delegateLoader.item.width : 0, height, optionsRow.maxItemWidth)
72 anchors {
73 top: parent.top
74 bottom: parent.bottom
75 }
76
77 Loader {
78 id: delegateLoader
79 height: parent.height
80 sourceComponent: panel.delegate ? panel.delegate : defaultDelegate
81 property Action option: modelData
82 onItemChanged: {
83 // this is needed only for testing purposes
84 if (item && item.objectName === "") {
85 item.objectName = "list_option_" + index
86 }
87 }
88 }
89 }
90 }
91 }
92
93 Component {
94 id: defaultDelegate
95 Item {
96 width: height
97 Icon {
98 width: units.gu(2.5)
99 height: width
100 name: option.iconName
101 // FIXME: use Palette colors instead when available
102 color: panel.leadingPanel ? "white" : UbuntuColors.lightGrey
103 anchors.centerIn: parent
104 }
105 }
52 }106 }
53}107}
54108
=== modified file 'tests/resources/listitems/ListItemTest.qml'
--- tests/resources/listitems/ListItemTest.qml 2014-09-15 08:41:36 +0000
+++ tests/resources/listitems/ListItemTest.qml 2014-09-15 08:41:37 +0000
@@ -27,16 +27,29 @@
27 Action {27 Action {
28 objectName: "stock"28 objectName: "stock"
29 id: stock29 id: stock
30 iconName: "starred"
31 onTriggered: print(iconName, "triggered")
30 }32 }
3133
32 ListItemOptions {34 ListItemOptions {
33 id: leading35 id: leading
34 objectName: "StockLeading"36 objectName: "StockLeading"
35 Action {37 Action {
36 }38 iconName: "delete"
37 Action {39 onTriggered: print(iconName, "triggered")
38 }40 }
39 Action {41 Action {
42 iconName: "alarm-clock"
43 enabled: false
44 onTriggered: print(iconName, "triggered")
45 }
46 Action {
47 iconName: "camcorder"
48 onTriggered: print(iconName, "triggered")
49 }
50 Action {
51 iconName: "stock_website"
52 onTriggered: print(iconName, "triggered")
40 }53 }
41 }54 }
4255
4356
=== modified file 'tests/unit_x11/tst_components/tst_listitem.qml'
--- tests/unit_x11/tst_components/tst_listitem.qml 2014-09-15 08:41:36 +0000
+++ tests/unit_x11/tst_components/tst_listitem.qml 2014-09-15 08:41:37 +0000
@@ -26,14 +26,18 @@
2626
27 Action {27 Action {
28 id: stockAction28 id: stockAction
29 iconName: "starred"
29 }30 }
30 ListItemOptions {31 ListItemOptions {
31 id: leading32 id: leading
32 Action {33 Action {
33 }34 iconName: "starred"
34 Action {35 }
35 }36 Action {
36 Action {37 iconName: "starred"
38 }
39 Action {
40 iconName: "starred"
37 }41 }
38 }42 }
39 ListItemOptions {43 ListItemOptions {
@@ -46,11 +50,13 @@
46 id: wrongOption50 id: wrongOption
47 Action {51 Action {
48 id: goodAction52 id: goodAction
53 iconName: "starred"
49 }54 }
50 QtObject {55 QtObject {
51 id: badAction56 id: badAction
52 }57 }
53 Action {58 Action {
59 iconName: "starred"
54 }60 }
55 }61 }
56 ListItemOptions {62 ListItemOptions {

Subscribers

People subscribed via source and target branches

to all changes: