Merge lp:~zsombi/ubuntu-ui-toolkit/40-visualize-options into lp:ubuntu-ui-toolkit/staging
- 40-visualize-options
- Merge into staging
Status: | Superseded |
---|---|
Proposed branch: | lp:~zsombi/ubuntu-ui-toolkit/40-visualize-options |
Merge into: | lp:ubuntu-ui-toolkit/staging |
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 |
Related bugs: | |
Related blueprints: |
SDK: Design a new ListItem and layouts
(Undefined)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu SDK team | Pending | ||
Review via email: mp+232425@code.launchpad.net |
Commit message
Visualization of the options from a ListItemOption
Description of the change
- 1226. By Zsombor Egri
-
rebounding moved to a separate MR
- 1227. By Zsombor Egri
-
remove unrelated code changes
- 1228. By Zsombor Egri
-
prereq merge
- 1229. By Zsombor Egri
-
prereq merge
- 1230. By Zsombor Egri
-
prereq merge
- 1231. By Zsombor Egri
-
prereq merge
- 1232. By Zsombor Egri
-
prereq merge
- 1233. By Zsombor Egri
-
prereq merge
- 1234. By Zsombor Egri
-
prereq merge
- 1235. By Zsombor Egri
-
prereq merge
- 1236. By Zsombor Egri
-
prereq
- 1237. By Zsombor Egri
-
prereq
- 1238. By Zsombor Egri
-
prereq
- 1239. By Zsombor Egri
-
prereq
- 1240. By Zsombor Egri
-
fix trailing panel color and icon colors
- 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
Preview Diff
1 | === modified file 'modules/Ubuntu/Components/ListItemPanel.qml' |
2 | --- modules/Ubuntu/Components/ListItemPanel.qml 2014-09-11 11:53:20 +0000 |
3 | +++ modules/Ubuntu/Components/ListItemPanel.qml 2014-09-11 11:53:21 +0000 |
4 | @@ -22,7 +22,7 @@ |
5 | */ |
6 | Item { |
7 | id: panel |
8 | - width: units.gu(20) |
9 | + width: optionsRow.childrenRect.width |
10 | |
11 | readonly property Item contentItem: parent ? parent.contentItem : null |
12 | /* |
13 | @@ -48,6 +48,60 @@ |
14 | |
15 | Rectangle { |
16 | anchors.fill: parent |
17 | - color: leadingPanel ? UbuntuColors.red : UbuntuColors.green |
18 | + // FIXME: use Palette colors instead when available |
19 | + color: leadingPanel ? UbuntuColors.red : "#00000000" |
20 | + } |
21 | + |
22 | + Row { |
23 | + id: optionsRow |
24 | + anchors { |
25 | + left: parent.left |
26 | + top: parent.top |
27 | + bottom: parent.bottom |
28 | + leftMargin: spacing |
29 | + } |
30 | + |
31 | + property real maxItemWidth: panel.parent ? (panel.parent.width / panel.optionList.length) : 0 |
32 | + |
33 | + Repeater { |
34 | + model: panel.optionList |
35 | + AbstractButton { |
36 | + action: modelData |
37 | + width: (!visible || !enabled) ? |
38 | + 0 : MathUtils.clamp(delegateLoader.item ? delegateLoader.item.width : 0, height, optionsRow.maxItemWidth) |
39 | + anchors { |
40 | + top: parent.top |
41 | + bottom: parent.bottom |
42 | + } |
43 | + |
44 | + Loader { |
45 | + id: delegateLoader |
46 | + height: parent.height |
47 | + sourceComponent: panel.delegate ? panel.delegate : defaultDelegate |
48 | + property Action option: modelData |
49 | + onItemChanged: { |
50 | + // this is needed only for testing purposes |
51 | + if (item && item.objectName === "") { |
52 | + item.objectName = "list_option_" + index |
53 | + } |
54 | + } |
55 | + } |
56 | + } |
57 | + } |
58 | + } |
59 | + |
60 | + Component { |
61 | + id: defaultDelegate |
62 | + Item { |
63 | + width: height |
64 | + Icon { |
65 | + width: units.gu(2.5) |
66 | + height: width |
67 | + name: option.iconName |
68 | + // FIXME: use Palette colors instead when available |
69 | + color: panel.leadingPanel ? "white" : UbuntuColors.lightGrey |
70 | + anchors.centerIn: parent |
71 | + } |
72 | + } |
73 | } |
74 | } |
75 | |
76 | === modified file 'tests/resources/listitems/ListItemTest.qml' |
77 | --- tests/resources/listitems/ListItemTest.qml 2014-09-11 11:53:20 +0000 |
78 | +++ tests/resources/listitems/ListItemTest.qml 2014-09-11 11:53:21 +0000 |
79 | @@ -27,16 +27,29 @@ |
80 | Action { |
81 | objectName: "stock" |
82 | id: stock |
83 | + iconName: "starred" |
84 | + onTriggered: print(iconName, "triggered") |
85 | } |
86 | |
87 | ListItemOptions { |
88 | id: leading |
89 | objectName: "StockLeading" |
90 | Action { |
91 | - } |
92 | - Action { |
93 | - } |
94 | - Action { |
95 | + iconName: "delete" |
96 | + onTriggered: print(iconName, "triggered") |
97 | + } |
98 | + Action { |
99 | + iconName: "alarm-clock" |
100 | + enabled: false |
101 | + onTriggered: print(iconName, "triggered") |
102 | + } |
103 | + Action { |
104 | + iconName: "camcorder" |
105 | + onTriggered: print(iconName, "triggered") |
106 | + } |
107 | + Action { |
108 | + iconName: "stock_website" |
109 | + onTriggered: print(iconName, "triggered") |
110 | } |
111 | } |
112 | |
113 | |
114 | === modified file 'tests/unit_x11/tst_components/tst_listitem.qml' |
115 | --- tests/unit_x11/tst_components/tst_listitem.qml 2014-09-11 11:53:20 +0000 |
116 | +++ tests/unit_x11/tst_components/tst_listitem.qml 2014-09-11 11:53:21 +0000 |
117 | @@ -26,14 +26,18 @@ |
118 | |
119 | Action { |
120 | id: stockAction |
121 | + iconName: "starred" |
122 | } |
123 | ListItemOptions { |
124 | id: leading |
125 | Action { |
126 | - } |
127 | - Action { |
128 | - } |
129 | - Action { |
130 | + iconName: "starred" |
131 | + } |
132 | + Action { |
133 | + iconName: "starred" |
134 | + } |
135 | + Action { |
136 | + iconName: "starred" |
137 | } |
138 | } |
139 | ListItemOptions { |
140 | @@ -46,11 +50,13 @@ |
141 | id: wrongOption |
142 | Action { |
143 | id: goodAction |
144 | + iconName: "starred" |
145 | } |
146 | QtObject { |
147 | id: badAction |
148 | } |
149 | Action { |
150 | + iconName: "starred" |
151 | } |
152 | } |
153 | ListItemOptions { |