Merge lp:~3v1n0/ubuntu-settings-components/touch+pointer-styles into lp:ubuntu-settings-components
- touch+pointer-styles
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Lukáš Tinkl |
Approved revision: | 290 |
Merged at revision: | 169 |
Proposed branch: | lp:~3v1n0/ubuntu-settings-components/touch+pointer-styles |
Merge into: | lp:ubuntu-settings-components |
Prerequisite: | lp:~3v1n0/ubuntu-settings-components/slots-layouts |
Diff against target: |
1390 lines (+475/-138) 39 files modified
debian/changelog (+17/-0) debian/control (+1/-1) examples/MessageComponents.qml (+5/-0) examples/OtherComponents.qml (+19/-15) examples/SettingsComponents.qml (+15/-0) examples/TransferComponents.qml (+3/-0) plugins/Ubuntu/Settings/Components/MessageHeader.qml (+23/-4) plugins/Ubuntu/Settings/Menus/AccessPointMenu.qml (+3/-4) plugins/Ubuntu/Settings/Menus/BaseLayoutMenu.qml (+7/-11) plugins/Ubuntu/Settings/Menus/BaseMenu.qml (+23/-15) plugins/Ubuntu/Settings/Menus/ButtonMenu.qml (+18/-5) plugins/Ubuntu/Settings/Menus/CMakeLists.txt (+2/-0) plugins/Ubuntu/Settings/Menus/CalendarMenu.qml (+3/-2) plugins/Ubuntu/Settings/Menus/CheckableMenu.qml (+2/-1) plugins/Ubuntu/Settings/Menus/EventMenu.qml (+2/-0) plugins/Ubuntu/Settings/Menus/GroupedMessageMenu.qml (+2/-2) plugins/Ubuntu/Settings/Menus/MediaPlayerMenu.qml (+17/-4) plugins/Ubuntu/Settings/Menus/ModemInfoItem.qml (+20/-10) plugins/Ubuntu/Settings/Menus/PlaybackButton.qml (+1/-1) plugins/Ubuntu/Settings/Menus/PlaybackItemMenu.qml (+8/-3) plugins/Ubuntu/Settings/Menus/ProgressBarMenu.qml (+3/-0) plugins/Ubuntu/Settings/Menus/ProgressValueMenu.qml (+1/-1) plugins/Ubuntu/Settings/Menus/SectionMenu.qml (+0/-2) plugins/Ubuntu/Settings/Menus/SimpleMessageMenu.qml (+3/-2) plugins/Ubuntu/Settings/Menus/SliderMenu.qml (+11/-11) plugins/Ubuntu/Settings/Menus/SnapDecisionMenu.qml (+2/-1) plugins/Ubuntu/Settings/Menus/StandardMenu.qml (+2/-2) plugins/Ubuntu/Settings/Menus/Style/BaseStyle.qml (+35/-0) plugins/Ubuntu/Settings/Menus/Style/CMakeLists.txt (+1/-0) plugins/Ubuntu/Settings/Menus/Style/MenuPaddings.qml (+26/-0) plugins/Ubuntu/Settings/Menus/Style/PointerStyle.qml (+38/-0) plugins/Ubuntu/Settings/Menus/Style/TouchStyle.qml (+40/-0) plugins/Ubuntu/Settings/Menus/Style/qmldir (+5/-0) plugins/Ubuntu/Settings/Menus/StyledSlotsLayout.qml (+32/-0) plugins/Ubuntu/Settings/Menus/TimeZoneMenu.qml (+2/-0) plugins/Ubuntu/Settings/Menus/TransferMenu.qml (+9/-5) plugins/Ubuntu/Settings/Menus/UserSessionMenu.qml (+2/-2) tests/qmltests/Menus/tst_BaseMenu.qml (+43/-26) tests/qmltests/Menus/tst_ButtonMenu.qml (+29/-8) |
To merge this branch: | bzr merge lp:~3v1n0/ubuntu-settings-components/touch+pointer-styles |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity8 CI Bot | continuous-integration | Approve | |
Lukáš Tinkl (community) | Approve | ||
Review via email:
|
Commit message
Menus: add Pointer and Touch styles to be used depending on the user interaction with components
Menu items now have a new Style property that defines some common properties such as shared colors and
sizes that change depending on the UX journey. I'm only defining Pointer and TouchStyles for now, but they
can be easily overridden in case.
Removed some deprecated properties and adapted colors and sizes to new style.
Description of the change
* Are there any related MPs required for this MP to build/function as expected? Please list.
Unity8 won't work with this without lp:~3v1n0/unity8/menuitems-slots-cleanup
The examples client won't update the menu items size on the fly (without resizing the window) unless without using lp:~3v1n0/ubuntu-ui-toolkit/slotslayout-paddings-changes-updates-size (not needed for other components for now)
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yep, ran in both laptop and phone
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
* If you changed the UI, has there been a design review?
I'm updating the paddings and sizes matching the new design specs
* If you changed localized strings, has the POT file been updated?
N/A
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:282
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 282. By Marco Trevisan (Treviño)
-
Merging with lp:~3v1n0/ubuntu-settings-components/slots-layouts
- 283. By Marco Trevisan (Treviño)
-
testButtonMenu: fix failures on vivid because of SignalSpy unrealiability
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:283
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 284. By Marco Trevisan (Treviño)
-
BaseMenu: bind ListItem height to menuHeight or it won't work because of bug #1630683
- 285. By Marco Trevisan (Treviño)
-
SimpleMessageMenu: animate menuHeight
- 286. By Marco Trevisan (Treviño)
-
Merging with lp:~3v1n0/ubuntu-settings-components/slots-layouts again
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:286
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 287. By Marco Trevisan (Treviño)
-
testBaseMenu: adapt to use height instead of implicitHeight
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:287
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 288. By Marco Trevisan (Treviño)
-
BaseStyle: use proper name for foregroud color
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:288
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 289. By Marco Trevisan (Treviño)
-
CheckableMenu: make the checkbox size to adapt to style
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:289
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Lukáš Tinkl (lukas-kde) wrote : | # |
Please get rid of specifying the font sizes using sth like:
font.pixelSize: menuStyle.
This will break with DGU (ie when you plug into an external monitor)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Lukáš Tinkl (lukas-kde) wrote : | # |
I'd go with:
Label.Medium (for the touch style, to stay backwards compatible) and
Label.Small (for the smaller pointer mode)
- 290. By Marco Trevisan (Treviño)
-
PointerStyle: ignore the default SlotsLayout paddings or we'll take them in account twice
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:290
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
> Please get rid of specifying the font sizes using sth like:
>
> font.pixelSize: menuStyle.
>
> This will break with DGU (ie when you plug into an external monitor)
Well, since menuStyle.
11:09:49 <Trevinho> greyback: hey, yesterday you were talking with ltinkl abou the label scaling when using pixelSize...
11:10:09 <greyback> yep?
11:10:11 <Trevinho> greyback: I was wondering why that doesn't happen when the pixelSize is bound to an units.gu value...
11:10:36 <Trevinho> isn't that like any other sized element?
11:11:03 <greyback> Trevinho: it would, if you did font.pixelSize: units.gu(2)
11:11:13 <Trevinho> greyback: so I did...
11:11:35 <Trevinho> greyback: I mean I've font.pixelSize: menuStyle.fontSize where fontSize is defined in GU's...
11:12:07 <greyback> Trevinho: ok, that should be fine
11:12:57 <Trevinho> greyback: ah, good then... As from yesterday's discussion it looked like it wasn't working properly when attaching a different monitor... But I wasn't understanding why :-)
11:13:54 <greyback> Trevinho: ack. I didn't know that the theme sizes were dynamic like that.
11:14:32 <Trevinho> greyback: that's something I defined for menu items only...
11:14:36 <Trevinho> so not generic solution
11:14:44 <Trevinho> but in my case it is
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Lukáš Tinkl (lukas-kde) wrote : | # |
Good, no objections from me then.
- 291. By Marco Trevisan (Treviño)
-
Menus: ensure that labels will use proper style foreground color
- 292. By Marco Trevisan (Treviño)
-
BaseStyle: foregroundColor should use backgroundText by default
- 293. By Marco Trevisan (Treviño)
-
MediaPlayerMenu: use proper colors for title and subtitle elements
- 294. By Marco Trevisan (Treviño)
-
ButtonMenu: use a custom button implementation in order to have better sizing
- 295. By Marco Trevisan (Treviño)
-
GroupedMessageMenu: use proper color for count number
- 296. By Marco Trevisan (Treviño)
-
Merging with lp:ubuntu-settings-components
- 297. By Marco Trevisan (Treviño)
-
debian: bump revision and breaks old unity8 versions
- 298. By Marco Trevisan (Treviño)
-
debian/changelog: add correct commit message here
- 299. By Marco Trevisan (Treviño)
-
SliderMenu: consider the whole column content as the height of the menu item
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:299
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'debian/changelog' |
2 | --- debian/changelog 2016-10-24 11:32:23 +0000 |
3 | +++ debian/changelog 2016-10-28 10:23:24 +0000 |
4 | @@ -1,3 +1,20 @@ |
5 | +ubuntu-settings-components (0.11) UNRELEASED; urgency=medium |
6 | + |
7 | + * Menus: add Pointer and Touch styles to be used depending on the user |
8 | + interaction with components |
9 | + |
10 | + Menu items now have a new Style property that defines some common properties |
11 | + such as shared colors and sizes that change depending on the UX journey. I'm |
12 | + only defining Pointer and TouchStyles for now, but they can be easily |
13 | + overridden in case. |
14 | + |
15 | + Removed some deprecated properties and adapted colors and sizes to new |
16 | + style. |
17 | + |
18 | + * Bump package version as there's a new API for various components |
19 | + |
20 | + -- Marco Trevisan (Treviño) <marco@ubuntu.com> Thu, 27 Oct 2016 13:46:39 +0200 |
21 | + |
22 | ubuntu-settings-components (0.10+17.04.20161024-0ubuntu1) zesty; urgency=medium |
23 | |
24 | [ Marco Trevisan (Treviño) ] |
25 | |
26 | === modified file 'debian/control' |
27 | --- debian/control 2016-09-22 11:39:11 +0000 |
28 | +++ debian/control 2016-10-28 10:23:24 +0000 |
29 | @@ -48,7 +48,7 @@ |
30 | suru-icon-theme, |
31 | ${misc:Depends}, |
32 | ${shlibs:Depends}, |
33 | -Breaks: qtdeclarative5-ubuntu-settings-components (<< 0.9), |
34 | +Breaks: qtdeclarative5-ubuntu-settings-components (<< 0.9), unity8 (<< 8.15) |
35 | Replaces: qtdeclarative5-ubuntu-settings-components (<< 0.9), |
36 | Description: Ubuntu settings Components |
37 | Ubuntu settings components for Unity8 |
38 | |
39 | === modified file 'examples/MessageComponents.qml' |
40 | --- examples/MessageComponents.qml 2016-10-05 14:08:27 +0000 |
41 | +++ examples/MessageComponents.qml 2016-10-28 10:23:24 +0000 |
42 | @@ -22,7 +22,9 @@ |
43 | import Ubuntu.Settings.Menus 0.1 |
44 | |
45 | Item { |
46 | + id: page |
47 | property string title: "MessageComponents" |
48 | + property bool pointerMode: false |
49 | |
50 | width: units.gu(42) |
51 | height: units.gu(75) |
52 | @@ -88,6 +90,7 @@ |
53 | body: model.body |
54 | time: model.time |
55 | removable: true |
56 | + pointerMode: page.pointerMode |
57 | |
58 | onIconActivated: { |
59 | print("Icon Activated") |
60 | @@ -103,6 +106,7 @@ |
61 | title: model.title |
62 | body: model.body |
63 | time: model.time |
64 | + pointerMode: page.pointerMode |
65 | removable: true |
66 | replyHintText: "Reply" |
67 | |
68 | @@ -124,6 +128,7 @@ |
69 | title: model.title |
70 | body: model.body |
71 | time: model.time |
72 | + pointerMode: page.pointerMode |
73 | removable: true |
74 | replyHintText: "Reply" |
75 | |
76 | |
77 | === modified file 'examples/OtherComponents.qml' |
78 | --- examples/OtherComponents.qml 2016-09-22 09:58:10 +0000 |
79 | +++ examples/OtherComponents.qml 2016-10-28 10:23:24 +0000 |
80 | @@ -22,7 +22,9 @@ |
81 | import Ubuntu.Settings.Menus 0.1 |
82 | |
83 | Item { |
84 | + id: page |
85 | property string title: "Settings Components" |
86 | + property bool pointerMode: false |
87 | |
88 | width: parent && parent.width ? parent.width : units.gu(42) |
89 | height: parent && parent.width ? parent.height : units.gu(75) |
90 | @@ -66,17 +68,10 @@ |
91 | onTriggered: console.log("Triggered") |
92 | } |
93 | |
94 | - StandardMenu { |
95 | - id: dividerToggleMenu |
96 | + ButtonMenu { |
97 | text: i18n.tr("Toggle divider menu.") |
98 | - showDivider: false |
99 | - |
100 | - slots: [ |
101 | - Button { |
102 | - text: dividerToggleMenu.showDivider ? i18n.tr("Hide") : i18n.tr("Show") |
103 | - onClicked: dividerToggleMenu.showDivider = !dividerToggleMenu.showDivider |
104 | - } |
105 | - ] |
106 | + buttonText: divider.visible ? i18n.tr("Hide") : i18n.tr("Show") |
107 | + onButtonClicked: divider.visible = !divider.visible |
108 | } |
109 | |
110 | StandardMenu { |
111 | @@ -96,11 +91,10 @@ |
112 | iconName: "calendar" |
113 | iconColor: "red" |
114 | text: i18n.tr("Standard Menu with Component") |
115 | - component: Component { |
116 | - Button { |
117 | - text: "Press Me" |
118 | - onClicked: print("Button pressed!") |
119 | - } |
120 | + slots: Button { |
121 | + text: "Press Me" |
122 | + onClicked: print("Button pressed!") |
123 | + color: theme.palette.normal.foreground |
124 | } |
125 | } |
126 | |
127 | @@ -260,6 +254,7 @@ |
128 | TimeZoneMenu { |
129 | city: model.city |
130 | time: model.time |
131 | + pointerMode: page.pointerMode |
132 | } |
133 | } |
134 | } |
135 | @@ -279,6 +274,15 @@ |
136 | eventColor: model.eventColor |
137 | time: model.time |
138 | enabled: false |
139 | + pointerMode: page.pointerMode |
140 | + } |
141 | + } |
142 | + } |
143 | + |
144 | + Component.onCompleted: { |
145 | + for (var i = 0; i < children.length; ++i) { |
146 | + if (children[i].pointerMode !== undefined) { |
147 | + children[i].pointerMode = Qt.binding(function() { return page.pointerMode }) |
148 | } |
149 | } |
150 | } |
151 | |
152 | === modified file 'examples/SettingsComponents.qml' |
153 | --- examples/SettingsComponents.qml 2016-09-17 00:12:01 +0000 |
154 | +++ examples/SettingsComponents.qml 2016-10-28 10:23:24 +0000 |
155 | @@ -29,6 +29,8 @@ |
156 | width: units.gu(50) |
157 | height: units.gu(100) |
158 | |
159 | + property bool pointerMode: true |
160 | + |
161 | Component.onCompleted: { |
162 | theme.name = "Ubuntu.Components.Themes.SuruDark" |
163 | } |
164 | @@ -45,6 +47,14 @@ |
165 | header: PageHeader { |
166 | id: header |
167 | title: listView.currentItem ? listView.currentItem.item.title : "Components" |
168 | + |
169 | + leadingActionBar.actions: [ |
170 | + Action { |
171 | + iconName: mainView.pointerMode ? "input-mouse-symbolic" : "input-touchpad-symbolic" |
172 | + text: mainView.pointerMode ? "Pointer mode" : "Touch mode" |
173 | + onTriggered: mainView.pointerMode = !mainView.pointerMode |
174 | + } |
175 | + ] |
176 | } |
177 | |
178 | clip: true |
179 | @@ -65,6 +75,11 @@ |
180 | height: ListView.view.height |
181 | |
182 | source: model.source |
183 | + onStatusChanged: { |
184 | + if (status == Loader.Ready) { |
185 | + item.pointerMode = Qt.binding(function() { return mainView.pointerMode }) |
186 | + } |
187 | + } |
188 | } |
189 | } |
190 | } |
191 | |
192 | === modified file 'examples/TransferComponents.qml' |
193 | --- examples/TransferComponents.qml 2016-02-11 11:23:02 +0000 |
194 | +++ examples/TransferComponents.qml 2016-10-28 10:23:24 +0000 |
195 | @@ -22,7 +22,9 @@ |
196 | import Ubuntu.Settings.Menus 0.1 |
197 | |
198 | Item { |
199 | + id: page |
200 | property string title: "Transfer Components" |
201 | + property bool pointerMode: false |
202 | |
203 | width: units.gu(42) |
204 | height: units.gu(75) |
205 | @@ -78,6 +80,7 @@ |
206 | progress: model.progress |
207 | iconSource: model.image |
208 | active: model.active |
209 | + pointerMode: page.pointerMode |
210 | } |
211 | } |
212 | } |
213 | |
214 | === modified file 'plugins/Ubuntu/Settings/Components/MessageHeader.qml' |
215 | --- plugins/Ubuntu/Settings/Components/MessageHeader.qml 2016-10-06 10:02:38 +0000 |
216 | +++ plugins/Ubuntu/Settings/Components/MessageHeader.qml 2016-10-28 10:23:24 +0000 |
217 | @@ -30,6 +30,7 @@ |
218 | property alias time: timeText.text |
219 | property alias title: itemLayout.title |
220 | property alias body: itemLayout.summary |
221 | + property QtObject menuStyle |
222 | |
223 | signal iconClicked() |
224 | |
225 | @@ -43,8 +44,15 @@ |
226 | ListItemLayout { |
227 | id: itemLayout |
228 | |
229 | + padding { |
230 | + top: menuStyle.padding.top |
231 | + bottom: menuStyle.padding.bottom |
232 | + leading: menuStyle.padding.leading |
233 | + trailing: menuStyle.padding.trailing |
234 | + } |
235 | + |
236 | UbuntuShape { |
237 | - width: units.gu(6) |
238 | + width: menuStyle.avatarSize |
239 | height: width |
240 | |
241 | SlotsLayout.position: SlotsLayout.Leading |
242 | @@ -60,24 +68,34 @@ |
243 | |
244 | Binding on color { |
245 | when: String(avatarImage.source).match(/^image:\/\/theme/) |
246 | - value: theme.palette.normal.backgroundText |
247 | + value: menuStyle.iconColor |
248 | } |
249 | } |
250 | } |
251 | |
252 | + padding { |
253 | + top: menuStyle.padding.top |
254 | + bottom: menuStyle.padding.bottom |
255 | + leading: menuStyle.padding.leading |
256 | + trailing: menuStyle.padding.trailing |
257 | + } |
258 | + |
259 | title.objectName: "title" |
260 | + title.color: menuStyle.foregroundColor |
261 | title.font.weight: Font.DemiBold |
262 | + title.font.pixelSize: menuStyle.fontSize |
263 | title.anchors.rightMargin: timeText.width > iconImage.width ? timeText.width - iconImage.width : 0 |
264 | |
265 | summary.objectName: "body" |
266 | summary.maximumLineCount: 3 |
267 | summary.wrapMode: Text.WordWrap |
268 | summary.elide: Text.ElideRight |
269 | + summary.font.pixelSize: menuStyle.subtitleFontSize |
270 | |
271 | Icon { |
272 | id: iconImage |
273 | objectName: "icon" |
274 | - color: theme.palette.normal.backgroundText |
275 | + color: menuStyle.iconColor |
276 | width: units.gu(3) |
277 | height: width |
278 | SlotsLayout.position: SlotsLayout.Trailing |
279 | @@ -116,7 +134,8 @@ |
280 | rightMargin: itemLayout.padding.trailing |
281 | } |
282 | |
283 | - fontSize: "x-small" |
284 | + color: menuStyle.foregroundColor |
285 | + textSize: Label.XSmall |
286 | maximumLineCount: 1 |
287 | } |
288 | } |
289 | |
290 | === modified file 'plugins/Ubuntu/Settings/Menus/AccessPointMenu.qml' |
291 | --- plugins/Ubuntu/Settings/Menus/AccessPointMenu.qml 2016-09-17 02:09:13 +0000 |
292 | +++ plugins/Ubuntu/Settings/Menus/AccessPointMenu.qml 2016-10-28 10:23:24 +0000 |
293 | @@ -29,8 +29,7 @@ |
294 | property alias secure: iconSecure.visible |
295 | |
296 | icon.objectName: "iconSignal" |
297 | - iconSize: Math.min(units.gu(3), parent.height - units.gu(1)) |
298 | - iconColor: ap.active ? theme.palette.normal.positive : theme.palette.normal.backgroundText |
299 | + iconColor: ap.active ? theme.palette.normal.positive : menuStyle.iconColor |
300 | iconName: { |
301 | if (adHoc) { |
302 | return "nm-adhoc"; |
303 | @@ -52,8 +51,8 @@ |
304 | objectName: "iconSecure" |
305 | visible: false |
306 | name: "network-secure" |
307 | - color: ap.active ? theme.palette.normal.positive : theme.palette.normal.backgroundText |
308 | + color: ap.active ? theme.palette.normal.positive : menuStyle.iconColor |
309 | width: height |
310 | - height: Math.min(units.gu(3), ap.parent.height - units.gu(1)) |
311 | + height: menuStyle.iconSize |
312 | } |
313 | } |
314 | |
315 | === modified file 'plugins/Ubuntu/Settings/Menus/BaseLayoutMenu.qml' |
316 | --- plugins/Ubuntu/Settings/Menus/BaseLayoutMenu.qml 2016-10-04 11:53:25 +0000 |
317 | +++ plugins/Ubuntu/Settings/Menus/BaseLayoutMenu.qml 2016-10-28 10:23:24 +0000 |
318 | @@ -29,24 +29,20 @@ |
319 | property alias summary: layoutItem.summary |
320 | property alias slots: layoutItem.children |
321 | |
322 | - // These fields are for retro-compatibility with ListItem.Empty based MenuItems |
323 | - property alias trailingComponent: trailingComponentLoader.sourceComponent |
324 | - property alias trailingComponentItem: trailingComponentLoader.item |
325 | - property alias component: menu.trailingComponent |
326 | - |
327 | - implicitHeight: layoutItem.height + (divider.visible ? divider.height : 0) |
328 | + menuHeight: layoutItem.height |
329 | |
330 | ListItemLayout { |
331 | id: layoutItem |
332 | objectName: "menuLayoutItem" |
333 | title.text: menu.text |
334 | title.color: menu.foregroundColor |
335 | + title.font.pixelSize: menuStyle.fontSize |
336 | |
337 | - Loader { |
338 | - id: trailingComponentLoader |
339 | - asynchronous: false |
340 | - visible: status == Loader.Ready |
341 | - SlotsLayout.position: SlotsLayout.Trailing |
342 | + padding { |
343 | + top: menuStyle.padding.top |
344 | + bottom: menuStyle.padding.bottom |
345 | + leading: menuStyle.padding.leading |
346 | + trailing: menuStyle.padding.trailing |
347 | } |
348 | } |
349 | } |
350 | |
351 | === modified file 'plugins/Ubuntu/Settings/Menus/BaseMenu.qml' |
352 | --- plugins/Ubuntu/Settings/Menus/BaseMenu.qml 2016-10-24 11:25:45 +0000 |
353 | +++ plugins/Ubuntu/Settings/Menus/BaseMenu.qml 2016-10-28 10:23:24 +0000 |
354 | @@ -18,27 +18,17 @@ |
355 | |
356 | import QtQuick 2.4 |
357 | import Ubuntu.Components 1.3 |
358 | +import Ubuntu.Settings.Menus.Style 0.1 |
359 | |
360 | ListItem { |
361 | id: menu |
362 | |
363 | + property bool pointerMode: false |
364 | property bool highlightWhenPressed: true |
365 | - property color foregroundColor: theme.palette.normal.baseText |
366 | + property real menuHeight: -1 |
367 | + property BaseStyle menuStyle: pointerMode ? PointerStyle : TouchStyle |
368 | property alias backColor: menu.color |
369 | - |
370 | - // Can't create an alias for divider.visible here, see QTBUG-50407 |
371 | - // Thus this hack is needed not to override the default divider.visible value |
372 | - property bool showDivider: false |
373 | - divider.visible: false |
374 | - Component.onCompleted: { |
375 | - if (showDivider != divider.visible) |
376 | - showDivider = divider.visible; |
377 | - |
378 | - divider.visible = Qt.binding(function() { return showDivider }) |
379 | - showDivider = Qt.binding(function() { return divider.visible }) |
380 | - } |
381 | - |
382 | - highlightColor: highlightWhenPressed ? theme.palette.highlighted.background : backColor |
383 | + property color foregroundColor: menuStyle.foregroundColor |
384 | |
385 | // This is for retro-compatibility with ListItem.Empty, adding support to override the callback |
386 | signal triggered(var value) |
387 | @@ -50,6 +40,24 @@ |
388 | onConfirmRemovalChanged: console.error(menu+": confirmRemoval property is deprecated") |
389 | signal itemRemoved() |
390 | |
391 | + divider.visible: false |
392 | + |
393 | + // FIXME: this is should use implicitHeight, but we can't yet due to lp:1630683 |
394 | + Binding on height { |
395 | + when: menuHeight >= 0 |
396 | + value: Math.max(menuStyle.minimumHeight, menuHeight) + (divider.visible ? divider.height : 0) |
397 | + } |
398 | + |
399 | + Binding on highlightColor { |
400 | + when: !highlightWhenPressed |
401 | + value: backColor |
402 | + } |
403 | + |
404 | + Binding on highlightColor { |
405 | + when: highlightWhenPressed && menuStyle |
406 | + value: menuStyle.highlightColor |
407 | + } |
408 | + |
409 | ListItemActions { |
410 | id: removeAction |
411 | actions: [ |
412 | |
413 | === modified file 'plugins/Ubuntu/Settings/Menus/ButtonMenu.qml' |
414 | --- plugins/Ubuntu/Settings/Menus/ButtonMenu.qml 2016-09-17 02:09:13 +0000 |
415 | +++ plugins/Ubuntu/Settings/Menus/ButtonMenu.qml 2016-10-28 10:23:24 +0000 |
416 | @@ -22,15 +22,28 @@ |
417 | |
418 | StandardMenu { |
419 | id: menu |
420 | - property alias buttonText: button.text |
421 | + property alias buttonText: buttonLabel.text |
422 | + signal buttonClicked() |
423 | |
424 | slots: [ |
425 | Button { |
426 | - id: button |
427 | objectName: "button" |
428 | - width: Math.max(units.gu(5), implicitWidth) |
429 | - |
430 | - onClicked: menu.clicked() |
431 | + color: menuStyle.buttonColor |
432 | + width: Math.max(units.gu(menu.pointerMode ? 5 : 8), buttonLabel.paintedWidth + units.gu(4)) |
433 | + height: menuStyle.buttonHeight |
434 | + |
435 | + Label { |
436 | + id: buttonLabel |
437 | + font.pixelSize: menuStyle.buttonFontSize |
438 | + color: theme.palette.normal.foregroundText |
439 | + anchors.centerIn: parent |
440 | + scale: parent.pressed ? 0.98 : 1 |
441 | + } |
442 | + |
443 | + onClicked: { |
444 | + menu.buttonClicked() |
445 | + menu.clicked() |
446 | + } |
447 | } |
448 | ] |
449 | } |
450 | |
451 | === modified file 'plugins/Ubuntu/Settings/Menus/CMakeLists.txt' |
452 | --- plugins/Ubuntu/Settings/Menus/CMakeLists.txt 2016-01-29 00:44:43 +0000 |
453 | +++ plugins/Ubuntu/Settings/Menus/CMakeLists.txt 2016-10-28 10:23:24 +0000 |
454 | @@ -1,3 +1,5 @@ |
455 | +add_subdirectory(Style) |
456 | + |
457 | project(UbuntuSettingsMenusQml) |
458 | |
459 | add_definitions(-DUBUNTUSETTINGSCOMPONENTS_LIBRARY) |
460 | |
461 | === modified file 'plugins/Ubuntu/Settings/Menus/CalendarMenu.qml' |
462 | --- plugins/Ubuntu/Settings/Menus/CalendarMenu.qml 2016-10-03 08:48:34 +0000 |
463 | +++ plugins/Ubuntu/Settings/Menus/CalendarMenu.qml 2016-10-28 10:23:24 +0000 |
464 | @@ -30,11 +30,12 @@ |
465 | property alias minimumDate: calendar.minimumDate |
466 | property alias selectedDate: calendar.selectedDate |
467 | |
468 | - implicitHeight: slotsLayout.height + (divider.visible ? divider.height : 0) |
469 | + menuHeight: slotsLayout.height |
470 | |
471 | - SlotsLayout { |
472 | + StyledSlotsLayout { |
473 | id: slotsLayout |
474 | objectName: "calenderMenuSlotsLayout" |
475 | + style: menuStyle |
476 | |
477 | mainSlot: Column { |
478 | id: column |
479 | |
480 | === modified file 'plugins/Ubuntu/Settings/Menus/CheckableMenu.qml' |
481 | --- plugins/Ubuntu/Settings/Menus/CheckableMenu.qml 2016-09-16 10:22:51 +0000 |
482 | +++ plugins/Ubuntu/Settings/Menus/CheckableMenu.qml 2016-10-28 10:23:24 +0000 |
483 | @@ -35,7 +35,8 @@ |
484 | id: checkbox |
485 | objectName: "checkbox" |
486 | onClicked: menu.triggered(checked) |
487 | - SlotsLayout.padding.trailing: units.gu(2.0) |
488 | + width: menuStyle.iconSize |
489 | + height: width |
490 | SlotsLayout.position: SlotsLayout.Leading |
491 | } |
492 | } |
493 | |
494 | === modified file 'plugins/Ubuntu/Settings/Menus/EventMenu.qml' |
495 | --- plugins/Ubuntu/Settings/Menus/EventMenu.qml 2016-09-21 13:06:31 +0000 |
496 | +++ plugins/Ubuntu/Settings/Menus/EventMenu.qml 2016-10-28 10:23:24 +0000 |
497 | @@ -31,5 +31,7 @@ |
498 | iconName: "calendar" |
499 | slots: Label { |
500 | id: dateLabel |
501 | + color: menu.foregroundColor |
502 | + font.pixelSize: menuStyle.fontSize |
503 | } |
504 | } |
505 | |
506 | === modified file 'plugins/Ubuntu/Settings/Menus/GroupedMessageMenu.qml' |
507 | --- plugins/Ubuntu/Settings/Menus/GroupedMessageMenu.qml 2016-09-15 11:37:30 +0000 |
508 | +++ plugins/Ubuntu/Settings/Menus/GroupedMessageMenu.qml 2016-10-28 10:23:24 +0000 |
509 | @@ -48,10 +48,10 @@ |
510 | } |
511 | horizontalAlignment: Text.AlignRight |
512 | font.weight: Font.DemiBold |
513 | - fontSize: "medium" |
514 | + font.pixelSize: menuStyle.fontSize |
515 | text: "0" |
516 | |
517 | - color: theme.palette.normal.foregroundText |
518 | + color: theme.palette.normal.foreground |
519 | } |
520 | } |
521 | ] |
522 | |
523 | === modified file 'plugins/Ubuntu/Settings/Menus/MediaPlayerMenu.qml' |
524 | --- plugins/Ubuntu/Settings/Menus/MediaPlayerMenu.qml 2016-10-04 11:54:00 +0000 |
525 | +++ plugins/Ubuntu/Settings/Menus/MediaPlayerMenu.qml 2016-10-28 10:23:24 +0000 |
526 | @@ -34,15 +34,15 @@ |
527 | property string album |
528 | |
529 | highlightWhenPressed: false |
530 | - implicitHeight: (albumLayout.visible ? albumLayout.height : layout.height) + (divider.visible ? divider.height : 0) |
531 | - Behavior on implicitHeight { UbuntuNumberAnimation {} } |
532 | + menuHeight: albumLayout.visible ? albumLayout.height : layout.height |
533 | + Behavior on menuHeight { UbuntuNumberAnimation {} } |
534 | |
535 | layout.visible: !albumLayout.visible |
536 | layout.objectName: "player" |
537 | |
538 | slots: Image { |
539 | id: playerIcon |
540 | - height: units.gu(5) |
541 | + height: menuStyle.avatarSize |
542 | width: height |
543 | SlotsLayout.position: SlotsLayout.Leading |
544 | } |
545 | @@ -51,12 +51,25 @@ |
546 | id: albumLayout |
547 | objectName: "albumArt" |
548 | visible: showTrack |
549 | + |
550 | + padding { |
551 | + top: menuStyle.padding.top |
552 | + bottom: menuStyle.padding.bottom |
553 | + leading: menuStyle.padding.leading |
554 | + trailing: menuStyle.padding.trailing |
555 | + } |
556 | + |
557 | title.text: menu.song |
558 | + title.font.pixelSize: menuStyle.fontSize |
559 | + title.color: menu.foregroundColor |
560 | subtitle.text: menu.artist |
561 | + subtitle.color: menu.foregroundColor |
562 | + subtitle.font.pixelSize: menuStyle.fontSize |
563 | summary.text: menu.album |
564 | + summary.font.pixelSize: menuStyle.subtitleFontSize |
565 | |
566 | UbuntuShape { |
567 | - width: units.gu(8) |
568 | + width: units.gu(7) |
569 | height: width |
570 | SlotsLayout.position: SlotsLayout.Leading |
571 | |
572 | |
573 | === modified file 'plugins/Ubuntu/Settings/Menus/ModemInfoItem.qml' |
574 | --- plugins/Ubuntu/Settings/Menus/ModemInfoItem.qml 2016-10-03 08:48:34 +0000 |
575 | +++ plugins/Ubuntu/Settings/Menus/ModemInfoItem.qml 2016-10-28 10:23:24 +0000 |
576 | @@ -31,11 +31,12 @@ |
577 | property bool roaming: false |
578 | signal unlock |
579 | |
580 | - implicitHeight: slotsLayout.height + (divider.visible ? divider.height : 0) |
581 | + menuHeight: slotsLayout.height |
582 | |
583 | - SlotsLayout { |
584 | + StyledSlotsLayout { |
585 | id: slotsLayout |
586 | objectName: "menuItemInfoSlotsLayout" |
587 | + style: menuStyle |
588 | |
589 | mainSlot: ColumnLayout { |
590 | spacing: units.gu(0.5) |
591 | @@ -44,8 +45,10 @@ |
592 | id: labelSimIdentifier |
593 | elide: Text.ElideRight |
594 | visible: text !== "" |
595 | + opacity: menu.locked ? 0.6 : 1.0 |
596 | + color: menu.foregroundColor |
597 | font.bold: true |
598 | - opacity: menu.locked ? 0.6 : 1.0 |
599 | + font.pixelSize: menuStyle.fontSize |
600 | } |
601 | |
602 | Row { |
603 | @@ -57,6 +60,8 @@ |
604 | id: labelStatus |
605 | elide: Text.ElideRight |
606 | opacity: 0.6 |
607 | + color: menu.foregroundColor |
608 | + font.pixelSize: menuStyle.fontSize |
609 | } |
610 | |
611 | Row { |
612 | @@ -64,9 +69,9 @@ |
613 | height: parent.height |
614 | Icon { |
615 | id: statusIcon |
616 | - color: theme.palette.normal.backgroundText |
617 | + color: menuStyle.iconColor |
618 | |
619 | - height: labelStatus.height |
620 | + height: menuStyle.iconSize |
621 | width: height |
622 | |
623 | visible: name !== "" |
624 | @@ -74,9 +79,9 @@ |
625 | |
626 | Icon { |
627 | id: iconConnectivity |
628 | - color: theme.palette.normal.backgroundText |
629 | + color: menuStyle.iconColor |
630 | |
631 | - width: statusIcon.width // fix lp:1585645 by breaking the binding loop |
632 | + width: menuStyle.iconSize |
633 | height: width |
634 | |
635 | visible: name !== "" |
636 | @@ -91,17 +96,18 @@ |
637 | id: labelRoaming |
638 | visible: menu.roaming |
639 | elide: Text.ElideRight |
640 | - fontSize: "x-small" |
641 | text: i18n.dtr("ubuntu-settings-components", "Roaming") |
642 | + font.pixelSize: menuStyle.subtitleFontSize |
643 | + color: menu.foregroundColor |
644 | opacity: 0.6 |
645 | } |
646 | |
647 | Icon { |
648 | id: iconRoaming |
649 | - color: theme.palette.normal.backgroundText |
650 | + color: menuStyle.iconColor |
651 | visible: menu.roaming |
652 | |
653 | - height: labelStatus.height |
654 | + height: menuStyle.iconSize |
655 | width: height |
656 | |
657 | name: "network-cellular-roaming" |
658 | @@ -113,9 +119,13 @@ |
659 | id: buttonUnlock |
660 | objectName: "buttonUnlockSim" |
661 | visible: menu.locked |
662 | + color: menuStyle.buttonColor |
663 | |
664 | text: i18n.dtr("ubuntu-settings-components", "Unlock SIM") |
665 | + font.pixelSize: menuStyle.buttonFontSize |
666 | Layout.preferredWidth: implicitWidth + units.gu(5) |
667 | + Layout.preferredHeight: menuStyle.buttonHeight |
668 | + height: menuStyle.buttonHeight |
669 | |
670 | onTriggered: menu.unlock() |
671 | } |
672 | |
673 | === modified file 'plugins/Ubuntu/Settings/Menus/PlaybackButton.qml' |
674 | --- plugins/Ubuntu/Settings/Menus/PlaybackButton.qml 2016-09-15 15:45:00 +0000 |
675 | +++ plugins/Ubuntu/Settings/Menus/PlaybackButton.qml 2016-10-28 10:23:24 +0000 |
676 | @@ -23,7 +23,7 @@ |
677 | id: button |
678 | objectName: "playbackButton" |
679 | |
680 | - property real size: units.gu(5) |
681 | + property real size: units.gu(3) |
682 | property alias iconName: icon.name |
683 | |
684 | width: size |
685 | |
686 | === modified file 'plugins/Ubuntu/Settings/Menus/PlaybackItemMenu.qml' |
687 | --- plugins/Ubuntu/Settings/Menus/PlaybackItemMenu.qml 2016-10-03 08:48:34 +0000 |
688 | +++ plugins/Ubuntu/Settings/Menus/PlaybackItemMenu.qml 2016-10-28 10:23:24 +0000 |
689 | @@ -33,20 +33,22 @@ |
690 | signal previous() |
691 | |
692 | highlightWhenPressed: false |
693 | - implicitHeight: layout.height + (divider.visible ? divider.height : 0) |
694 | + menuHeight: layout.height |
695 | |
696 | - SlotsLayout { |
697 | + StyledSlotsLayout { |
698 | id: layout |
699 | objectName: "playbackMenuLayout" |
700 | + style: menuStyle |
701 | |
702 | Row { |
703 | anchors.centerIn: parent |
704 | - spacing: units.gu(3) |
705 | + spacing: units.gu(pointerMode ? 2 : 2.5) |
706 | |
707 | PlaybackButton { |
708 | objectName: "previousButton" |
709 | iconName: "media-skip-backward" |
710 | enabled: canGoPrevious |
711 | + anchors.verticalCenter: parent.verticalCenter |
712 | onClicked: menu.previous() |
713 | } |
714 | |
715 | @@ -54,6 +56,8 @@ |
716 | objectName: "playButton" |
717 | iconName: playing ? "media-playback-pause" : "media-playback-start" |
718 | enabled: canPlay |
719 | + size: menuStyle.avatarSize |
720 | + anchors.verticalCenter: parent.verticalCenter |
721 | onClicked: menu.play(!playing) |
722 | } |
723 | |
724 | @@ -61,6 +65,7 @@ |
725 | objectName: "nextButton" |
726 | iconName: "media-skip-forward" |
727 | enabled: canGoNext |
728 | + anchors.verticalCenter: parent.verticalCenter |
729 | onClicked: menu.next() |
730 | } |
731 | } |
732 | |
733 | === modified file 'plugins/Ubuntu/Settings/Menus/ProgressBarMenu.qml' |
734 | --- plugins/Ubuntu/Settings/Menus/ProgressBarMenu.qml 2016-09-15 11:52:10 +0000 |
735 | +++ plugins/Ubuntu/Settings/Menus/ProgressBarMenu.qml 2016-10-28 10:23:24 +0000 |
736 | @@ -36,6 +36,9 @@ |
737 | minimumValue: 0.0 |
738 | maximumValue: 1.0 |
739 | value: 0.0 |
740 | + |
741 | + SlotsLayout.overrideVerticalPositioning: true |
742 | + anchors.verticalCenter: parent.verticalCenter |
743 | } |
744 | ] |
745 | } |
746 | |
747 | === modified file 'plugins/Ubuntu/Settings/Menus/ProgressValueMenu.qml' |
748 | --- plugins/Ubuntu/Settings/Menus/ProgressValueMenu.qml 2016-09-15 14:01:32 +0000 |
749 | +++ plugins/Ubuntu/Settings/Menus/ProgressValueMenu.qml 2016-10-28 10:23:24 +0000 |
750 | @@ -32,8 +32,8 @@ |
751 | objectName: "progress" |
752 | |
753 | text: menuItem.value + " %" |
754 | - fontSize: "medium" |
755 | color: menuItem.foregroundColor |
756 | + font.pixelSize: menuStyle.fontSize |
757 | } |
758 | ] |
759 | } |
760 | |
761 | === modified file 'plugins/Ubuntu/Settings/Menus/SectionMenu.qml' |
762 | --- plugins/Ubuntu/Settings/Menus/SectionMenu.qml 2016-09-15 11:57:30 +0000 |
763 | +++ plugins/Ubuntu/Settings/Menus/SectionMenu.qml 2016-10-28 10:23:24 +0000 |
764 | @@ -24,9 +24,7 @@ |
765 | StandardMenu { |
766 | id: menuItem |
767 | property alias busy: indicator.running |
768 | - |
769 | divider.visible: true |
770 | - foregroundColor: theme.palette.normal.backgroundText |
771 | |
772 | slots: ActivityIndicator { |
773 | id: indicator |
774 | |
775 | === modified file 'plugins/Ubuntu/Settings/Menus/SimpleMessageMenu.qml' |
776 | --- plugins/Ubuntu/Settings/Menus/SimpleMessageMenu.qml 2016-10-24 11:25:45 +0000 |
777 | +++ plugins/Ubuntu/Settings/Menus/SimpleMessageMenu.qml 2016-10-28 10:23:24 +0000 |
778 | @@ -39,7 +39,7 @@ |
779 | property alias footer: footerContainer.children |
780 | property real _animationDuration: UbuntuAnimation.FastDuration |
781 | |
782 | - height: layout.height + (divider.visible ? divider.height : 0) |
783 | + menuHeight: layout.height |
784 | clip: leadingActions || trailingActions || heightAnimation.running |
785 | |
786 | Column { |
787 | @@ -52,6 +52,7 @@ |
788 | avatar: menu.avatar != "" ? menu.avatar : "image://theme/contact" |
789 | icon: menu.icon != "" ? menu.icon : "image://theme/message" |
790 | state: menu.state |
791 | + menuStyle: menu.menuStyle |
792 | title.text: menu.title |
793 | body.text: menu.body |
794 | |
795 | @@ -76,7 +77,7 @@ |
796 | } |
797 | } |
798 | |
799 | - Behavior on height { |
800 | + Behavior on menuHeight { |
801 | NumberAnimation { |
802 | id: heightAnimation |
803 | duration: _animationDuration |
804 | |
805 | === modified file 'plugins/Ubuntu/Settings/Menus/SliderMenu.qml' |
806 | --- plugins/Ubuntu/Settings/Menus/SliderMenu.qml 2016-10-03 08:48:34 +0000 |
807 | +++ plugins/Ubuntu/Settings/Menus/SliderMenu.qml 2016-10-28 10:23:24 +0000 |
808 | @@ -32,9 +32,6 @@ |
809 | property alias minIcon: leftButton.source |
810 | property alias maxIcon: rightButton.source |
811 | |
812 | - // These fields are for retro-compatibility with ListItem.Empty |
813 | - property string iconSource |
814 | - |
815 | signal updated(real value) |
816 | |
817 | property QtObject d: QtObject { |
818 | @@ -97,25 +94,28 @@ |
819 | } |
820 | } |
821 | |
822 | - implicitHeight: slotsLayout.height + (divider.visible ? divider.height : 0) |
823 | + menuHeight: column.childrenRect.height + column.anchors.topMargin + column.anchors.bottomMargin |
824 | highlightWhenPressed: false |
825 | |
826 | Column { |
827 | id: column |
828 | anchors.fill: parent |
829 | - anchors.topMargin: units.gu(0.5) |
830 | + anchors.topMargin: label.visible ? menuStyle.padding.top : 0 |
831 | spacing: -units.gu(1.5) |
832 | |
833 | Label { |
834 | id: label |
835 | visible: text != "" |
836 | + color: menu.foregroundColor |
837 | + font.pixelSize: menuStyle.fontSize |
838 | x: Qt.application.layoutDirection == Qt.LeftToRight ? |
839 | leftButton.x : rightButton.x + rightButton.width - width |
840 | } |
841 | |
842 | - SlotsLayout { |
843 | + StyledSlotsLayout { |
844 | id: slotsLayout |
845 | objectName: "sliderMenuSlotsLayout" |
846 | + style: menuStyle |
847 | |
848 | mainSlot: Slider { |
849 | id: slider |
850 | @@ -154,9 +154,9 @@ |
851 | id: leftButton |
852 | objectName: "leftButton" |
853 | visible: source !== "" |
854 | - height: slider.height - units.gu(2) |
855 | + height: menuStyle.iconSize |
856 | width: height |
857 | - color: theme.palette.normal.backgroundText |
858 | + color: menuStyle.iconColor |
859 | |
860 | AbstractButton { |
861 | anchors.fill: parent |
862 | @@ -172,13 +172,13 @@ |
863 | id: rightButton |
864 | objectName: "rightButton" |
865 | visible: source !== "" |
866 | - height: slider.height - units.gu(2) |
867 | + height: menuStyle.iconSize |
868 | width: height |
869 | - color: theme.palette.normal.backgroundText |
870 | + color: menuStyle.iconColor |
871 | |
872 | AbstractButton { |
873 | anchors.fill: parent |
874 | - onClicked: slider.value = slider.maximumValue |
875 | + onClicked: slider.value = slider.maximumValue |
876 | } |
877 | |
878 | SlotsLayout.position: SlotsLayout.Trailing |
879 | |
880 | === modified file 'plugins/Ubuntu/Settings/Menus/SnapDecisionMenu.qml' |
881 | --- plugins/Ubuntu/Settings/Menus/SnapDecisionMenu.qml 2016-10-03 08:48:34 +0000 |
882 | +++ plugins/Ubuntu/Settings/Menus/SnapDecisionMenu.qml 2016-10-28 10:23:24 +0000 |
883 | @@ -50,8 +50,9 @@ |
884 | right: parent.right |
885 | } |
886 | |
887 | - SlotsLayout { |
888 | + StyledSlotsLayout { |
889 | id: slotsLayout |
890 | + style: menuStyle |
891 | padding.top: 0 |
892 | |
893 | mainSlot: Row { |
894 | |
895 | === modified file 'plugins/Ubuntu/Settings/Menus/StandardMenu.qml' |
896 | --- plugins/Ubuntu/Settings/Menus/StandardMenu.qml 2016-09-20 16:34:00 +0000 |
897 | +++ plugins/Ubuntu/Settings/Menus/StandardMenu.qml 2016-10-28 10:23:24 +0000 |
898 | @@ -31,9 +31,9 @@ |
899 | slots: Icon { |
900 | id: icon |
901 | objectName: "standardMenuIcon" |
902 | - color: theme.palette.normal.backgroundText |
903 | + color: menuStyle.iconColor |
904 | visible: source != "" |
905 | - height: units.gu(3) |
906 | + height: menuStyle.iconSize |
907 | width: height |
908 | SlotsLayout.position: SlotsLayout.Leading |
909 | } |
910 | |
911 | === added directory 'plugins/Ubuntu/Settings/Menus/Style' |
912 | === added file 'plugins/Ubuntu/Settings/Menus/Style/BaseStyle.qml' |
913 | --- plugins/Ubuntu/Settings/Menus/Style/BaseStyle.qml 1970-01-01 00:00:00 +0000 |
914 | +++ plugins/Ubuntu/Settings/Menus/Style/BaseStyle.qml 2016-10-28 10:23:24 +0000 |
915 | @@ -0,0 +1,35 @@ |
916 | +/* |
917 | + * Copyright 2016 Canonical Ltd. |
918 | + * |
919 | + * This program is free software; you can redistribute it and/or modify |
920 | + * it under the terms of the GNU Lesser General Public License as published by |
921 | + * the Free Software Foundation; version 3. |
922 | + * |
923 | + * This program is distributed in the hope that it will be useful, |
924 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
925 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
926 | + * GNU Lesser General Public License for more details. |
927 | + * |
928 | + * You should have received a copy of the GNU Lesser General Public License |
929 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
930 | + * |
931 | + * Author: Marco Trevisan <marco.trevisan@canonical.com> |
932 | + */ |
933 | + |
934 | +import QtQuick 2.4 |
935 | + |
936 | +QtObject { |
937 | + readonly property MenuPaddings padding: MenuPaddings {} |
938 | + readonly property real subtitleFontSize: units.gu(1.4) |
939 | + readonly property real avatarSize: units.gu(4) |
940 | + readonly property color foregroundColor: theme.palette.normal.backgroundText |
941 | + readonly property color highlightColor: theme.palette.highlighted.background |
942 | + readonly property color iconColor: foregroundColor |
943 | + readonly property color buttonColor: theme.palette.normal.foreground |
944 | + |
945 | + property real minimumHeight |
946 | + property real fontSize |
947 | + property real iconSize |
948 | + property real buttonFontSize |
949 | + property real buttonHeight |
950 | +} |
951 | |
952 | === added file 'plugins/Ubuntu/Settings/Menus/Style/CMakeLists.txt' |
953 | --- plugins/Ubuntu/Settings/Menus/Style/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
954 | +++ plugins/Ubuntu/Settings/Menus/Style/CMakeLists.txt 2016-10-28 10:23:24 +0000 |
955 | @@ -0,0 +1,1 @@ |
956 | +add_usc_plugin(Ubuntu.Settings.Menus.Style 0.1 Ubuntu/Settings/Menus/Style) |
957 | |
958 | === added file 'plugins/Ubuntu/Settings/Menus/Style/MenuPaddings.qml' |
959 | --- plugins/Ubuntu/Settings/Menus/Style/MenuPaddings.qml 1970-01-01 00:00:00 +0000 |
960 | +++ plugins/Ubuntu/Settings/Menus/Style/MenuPaddings.qml 2016-10-28 10:23:24 +0000 |
961 | @@ -0,0 +1,26 @@ |
962 | +/* |
963 | + * Copyright 2016 Canonical Ltd. |
964 | + * |
965 | + * This program is free software; you can redistribute it and/or modify |
966 | + * it under the terms of the GNU Lesser General Public License as published by |
967 | + * the Free Software Foundation; version 3. |
968 | + * |
969 | + * This program is distributed in the hope that it will be useful, |
970 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
971 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
972 | + * GNU Lesser General Public License for more details. |
973 | + * |
974 | + * You should have received a copy of the GNU Lesser General Public License |
975 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
976 | + * |
977 | + * Author: Marco Trevisan <marco.trevisan@canonical.com> |
978 | + */ |
979 | + |
980 | +import QtQuick 2.4 |
981 | + |
982 | +QtObject { |
983 | + property real top |
984 | + property real bottom |
985 | + property real leading |
986 | + property real trailing |
987 | +} |
988 | |
989 | === added file 'plugins/Ubuntu/Settings/Menus/Style/PointerStyle.qml' |
990 | --- plugins/Ubuntu/Settings/Menus/Style/PointerStyle.qml 1970-01-01 00:00:00 +0000 |
991 | +++ plugins/Ubuntu/Settings/Menus/Style/PointerStyle.qml 2016-10-28 10:23:24 +0000 |
992 | @@ -0,0 +1,38 @@ |
993 | +/* |
994 | + * Copyright 2016 Canonical Ltd. |
995 | + * |
996 | + * This program is free software; you can redistribute it and/or modify |
997 | + * it under the terms of the GNU Lesser General Public License as published by |
998 | + * the Free Software Foundation; version 3. |
999 | + * |
1000 | + * This program is distributed in the hope that it will be useful, |
1001 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1002 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1003 | + * GNU Lesser General Public License for more details. |
1004 | + * |
1005 | + * You should have received a copy of the GNU Lesser General Public License |
1006 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1007 | + * |
1008 | + * Author: Marco Trevisan <marco.trevisan@canonical.com> |
1009 | + */ |
1010 | + |
1011 | +pragma Singleton |
1012 | +import QtQuick 2.4 |
1013 | +import Ubuntu.Components 1.3 |
1014 | + |
1015 | +BaseStyle { |
1016 | + id: style |
1017 | + |
1018 | + padding { |
1019 | + top: units.gu(1) - SlotsLayout.padding.top |
1020 | + bottom: units.gu(0.9) - SlotsLayout.padding.bottom |
1021 | + leading: units.gu(3) - SlotsLayout.padding.leading |
1022 | + trailing: units.gu(2) - SlotsLayout.padding.trailing |
1023 | + } |
1024 | + |
1025 | + minimumHeight: units.gu(3.9) |
1026 | + fontSize: units.gu(1.7) |
1027 | + iconSize: units.gu(2) |
1028 | + buttonFontSize: units.gu(1.4) |
1029 | + buttonHeight: units.gu(2) |
1030 | +} |
1031 | |
1032 | === added file 'plugins/Ubuntu/Settings/Menus/Style/TouchStyle.qml' |
1033 | --- plugins/Ubuntu/Settings/Menus/Style/TouchStyle.qml 1970-01-01 00:00:00 +0000 |
1034 | +++ plugins/Ubuntu/Settings/Menus/Style/TouchStyle.qml 2016-10-28 10:23:24 +0000 |
1035 | @@ -0,0 +1,40 @@ |
1036 | +/* |
1037 | + * Copyright 2016 Canonical Ltd. |
1038 | + * |
1039 | + * This program is free software; you can redistribute it and/or modify |
1040 | + * it under the terms of the GNU Lesser General Public License as published by |
1041 | + * the Free Software Foundation; version 3. |
1042 | + * |
1043 | + * This program is distributed in the hope that it will be useful, |
1044 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1045 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1046 | + * GNU Lesser General Public License for more details. |
1047 | + * |
1048 | + * You should have received a copy of the GNU Lesser General Public License |
1049 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1050 | + * |
1051 | + * Author: Marco Trevisan <marco.trevisan@canonical.com> |
1052 | + */ |
1053 | + |
1054 | +pragma Singleton |
1055 | +import QtQuick 2.4 |
1056 | +import Ubuntu.Components 1.3 |
1057 | + |
1058 | +BaseStyle { |
1059 | + id: style |
1060 | + |
1061 | + readonly property SlotsLayout __reference_layout: SlotsLayout {} |
1062 | + |
1063 | + padding { |
1064 | + top: __reference_layout.padding.top |
1065 | + bottom: __reference_layout.padding.bottom |
1066 | + leading: __reference_layout.padding.leading |
1067 | + trailing: __reference_layout.padding.trailing |
1068 | + } |
1069 | + |
1070 | + minimumHeight: units.gu(5.9) |
1071 | + fontSize: units.gu(2) |
1072 | + iconSize: units.gu(2.5) |
1073 | + buttonFontSize: units.gu(1.7) |
1074 | + buttonHeight: units.gu(3) |
1075 | +} |
1076 | |
1077 | === added file 'plugins/Ubuntu/Settings/Menus/Style/qmldir' |
1078 | --- plugins/Ubuntu/Settings/Menus/Style/qmldir 1970-01-01 00:00:00 +0000 |
1079 | +++ plugins/Ubuntu/Settings/Menus/Style/qmldir 2016-10-28 10:23:24 +0000 |
1080 | @@ -0,0 +1,5 @@ |
1081 | +module Ubuntu.Settings.Menus.Style |
1082 | + |
1083 | +BaseStyle 0.1 BaseStyle.qml |
1084 | +singleton PointerStyle 0.1 PointerStyle.qml |
1085 | +singleton TouchStyle 0.1 TouchStyle.qml |
1086 | |
1087 | === added file 'plugins/Ubuntu/Settings/Menus/StyledSlotsLayout.qml' |
1088 | --- plugins/Ubuntu/Settings/Menus/StyledSlotsLayout.qml 1970-01-01 00:00:00 +0000 |
1089 | +++ plugins/Ubuntu/Settings/Menus/StyledSlotsLayout.qml 2016-10-28 10:23:24 +0000 |
1090 | @@ -0,0 +1,32 @@ |
1091 | +/* |
1092 | + * Copyright 2016 Canonical Ltd. |
1093 | + * |
1094 | + * This program is free software; you can redistribute it and/or modify |
1095 | + * it under the terms of the GNU Lesser General Public License as published by |
1096 | + * the Free Software Foundation; version 3. |
1097 | + * |
1098 | + * This program is distributed in the hope that it will be useful, |
1099 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1100 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1101 | + * GNU Lesser General Public License for more details. |
1102 | + * |
1103 | + * You should have received a copy of the GNU Lesser General Public License |
1104 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1105 | + * |
1106 | + * Author: Marco Trevisan <marco.trevisan@canonical.com> |
1107 | + */ |
1108 | + |
1109 | +import QtQuick 2.4 |
1110 | +import Ubuntu.Components 1.3 |
1111 | +import Ubuntu.Settings.Menus.Style 0.1 |
1112 | + |
1113 | +SlotsLayout { |
1114 | + property BaseStyle style |
1115 | + |
1116 | + padding { |
1117 | + top: style.padding.top |
1118 | + bottom: style.padding.bottom |
1119 | + leading: style.padding.leading |
1120 | + trailing: style.padding.trailing |
1121 | + } |
1122 | +} |
1123 | |
1124 | === modified file 'plugins/Ubuntu/Settings/Menus/TimeZoneMenu.qml' |
1125 | --- plugins/Ubuntu/Settings/Menus/TimeZoneMenu.qml 2016-09-15 11:08:17 +0000 |
1126 | +++ plugins/Ubuntu/Settings/Menus/TimeZoneMenu.qml 2016-10-28 10:23:24 +0000 |
1127 | @@ -28,5 +28,7 @@ |
1128 | slots: Label { |
1129 | id: timeLabel |
1130 | objectName: "timeLabel" |
1131 | + color: timeZoneMenu.foregroundColor |
1132 | + font.pixelSize: menuStyle.fontSize |
1133 | } |
1134 | } |
1135 | |
1136 | === modified file 'plugins/Ubuntu/Settings/Menus/TransferMenu.qml' |
1137 | --- plugins/Ubuntu/Settings/Menus/TransferMenu.qml 2016-10-03 08:48:34 +0000 |
1138 | +++ plugins/Ubuntu/Settings/Menus/TransferMenu.qml 2016-10-28 10:23:24 +0000 |
1139 | @@ -31,15 +31,16 @@ |
1140 | property alias maximum: progressBar.maximumValue |
1141 | property bool active: false |
1142 | |
1143 | - implicitHeight: slotsLayout.height + (divider.visible ? divider.height : 0) |
1144 | + menuHeight: slotsLayout.height |
1145 | |
1146 | - SlotsLayout { |
1147 | + StyledSlotsLayout { |
1148 | id: slotsLayout |
1149 | objectName: "transferMenuSlotsLayout" |
1150 | + style: menuStyle |
1151 | |
1152 | UbuntuShape { |
1153 | SlotsLayout.position: SlotsLayout.Leading |
1154 | - width: units.gu(6) |
1155 | + width: menuStyle.avatarSize |
1156 | height: width |
1157 | |
1158 | source: ShaderEffectSource { |
1159 | @@ -52,7 +53,7 @@ |
1160 | |
1161 | color: { |
1162 | if (String(source).match(/^image:\/\/theme/)) { |
1163 | - return theme.palette.normal.backgroundText; |
1164 | + return menuStyle.iconColor; |
1165 | } |
1166 | return Qt.rgba(0.0, 0.0, 0.0, 0.0); |
1167 | } |
1168 | @@ -68,7 +69,9 @@ |
1169 | anchors { left: parent.left; right: parent.right } |
1170 | elide: Text.ElideRight |
1171 | maximumLineCount: 1 |
1172 | + color: menu.foregroundColor |
1173 | font.weight: Font.DemiBold |
1174 | + font.pixelSize: menuStyle.fontSize |
1175 | } |
1176 | |
1177 | ProgressBar { |
1178 | @@ -85,8 +88,9 @@ |
1179 | id: stateLabel |
1180 | objectName: "stateText" |
1181 | anchors { left: parent.left; right: parent.right } |
1182 | + font.pixelSize: menuStyle.subtitleFontSize |
1183 | + color: menu.foregroundColor |
1184 | visible: menu.active |
1185 | - fontSize: "x-small" |
1186 | elide: Text.ElideRight |
1187 | maximumLineCount: 1 |
1188 | } |
1189 | |
1190 | === modified file 'plugins/Ubuntu/Settings/Menus/UserSessionMenu.qml' |
1191 | --- plugins/Ubuntu/Settings/Menus/UserSessionMenu.qml 2016-09-15 11:43:42 +0000 |
1192 | +++ plugins/Ubuntu/Settings/Menus/UserSessionMenu.qml 2016-10-28 10:23:24 +0000 |
1193 | @@ -34,13 +34,13 @@ |
1194 | implicitHeight: checkMark.height + units.gu(1) |
1195 | radius: width / 2 |
1196 | antialiasing: true |
1197 | - color: theme.palette.normal.backgroundText |
1198 | + color: menuStyle.iconColor |
1199 | visible: false |
1200 | |
1201 | Icon { |
1202 | id: checkMark |
1203 | name: "tick" |
1204 | - height: units.gu(2) |
1205 | + height: menuStyle.iconSize |
1206 | width: height |
1207 | anchors.centerIn: parent |
1208 | } |
1209 | |
1210 | === modified file 'tests/qmltests/Menus/tst_BaseMenu.qml' |
1211 | --- tests/qmltests/Menus/tst_BaseMenu.qml 2016-09-22 10:09:54 +0000 |
1212 | +++ tests/qmltests/Menus/tst_BaseMenu.qml 2016-10-28 10:23:24 +0000 |
1213 | @@ -20,6 +20,7 @@ |
1214 | import QtTest 1.0 |
1215 | import Ubuntu.Test 0.1 |
1216 | import Ubuntu.Settings.Menus 0.1 |
1217 | +import Ubuntu.Settings.Menus.Style 0.1 |
1218 | |
1219 | Item { |
1220 | width: units.gu(42) |
1221 | @@ -38,11 +39,6 @@ |
1222 | } |
1223 | |
1224 | BaseMenu { |
1225 | - id: legacyDividerMenu |
1226 | - showDivider: true |
1227 | - } |
1228 | - |
1229 | - BaseMenu { |
1230 | id: clickOverride |
1231 | property bool clicked: false |
1232 | function onClickedCallback() { clicked = true } |
1233 | @@ -52,6 +48,21 @@ |
1234 | id: removableMenu |
1235 | removable: true |
1236 | } |
1237 | + |
1238 | + BaseMenu { |
1239 | + id: pointerModeMenu |
1240 | + pointerMode: true |
1241 | + } |
1242 | + |
1243 | + BaseMenu { |
1244 | + id: touchModeMenu |
1245 | + pointerMode: false |
1246 | + } |
1247 | + |
1248 | + BaseMenu { |
1249 | + id: menuHeightMenu |
1250 | + menuHeight: units.gu(10) |
1251 | + } |
1252 | } |
1253 | |
1254 | SignalSpy { |
1255 | @@ -76,44 +87,42 @@ |
1256 | function test_doHighlightWhenPressed() { |
1257 | baseMenu.highlightWhenPressed = true; |
1258 | mousePress(baseMenu, baseMenu.width/2, baseMenu.height/2) |
1259 | - compare(Qt.colorEqual(baseMenu.highlightColor, theme.palette.highlighted.background), true) |
1260 | + compare(Qt.colorEqual(baseMenu.highlightColor, baseMenu.menuStyle.highlightColor), true) |
1261 | mouseRelease(baseMenu) |
1262 | } |
1263 | |
1264 | function test_showDivider() { |
1265 | - compare(baseMenu.showDivider, false) |
1266 | compare(baseMenu.divider.visible, false) |
1267 | |
1268 | - baseMenu.showDivider = true |
1269 | - compare(baseMenu.showDivider, true) |
1270 | + baseMenu.divider.visible = true |
1271 | compare(baseMenu.divider.visible, true) |
1272 | |
1273 | - baseMenu.showDivider = false |
1274 | + baseMenu.divider.visible = false |
1275 | compare(baseMenu.divider.visible, false) |
1276 | - compare(baseMenu.showDivider, false) |
1277 | } |
1278 | |
1279 | function test_hideDivider() { |
1280 | - compare(dividerMenu.showDivider, true) |
1281 | compare(dividerMenu.divider.visible, true) |
1282 | |
1283 | - dividerMenu.showDivider = false |
1284 | - compare(dividerMenu.showDivider, false) |
1285 | + dividerMenu.divider.visible = false |
1286 | compare(dividerMenu.divider.visible, false) |
1287 | |
1288 | - dividerMenu.showDivider = true |
1289 | + dividerMenu.divider.visible = true |
1290 | compare(dividerMenu.divider.visible, true) |
1291 | - compare(dividerMenu.showDivider, true) |
1292 | - } |
1293 | - |
1294 | - function test_hideDividerLegacy() { |
1295 | - legacyDividerMenu.showDivider = false |
1296 | - compare(legacyDividerMenu.showDivider, false) |
1297 | - compare(legacyDividerMenu.divider.visible, false) |
1298 | - |
1299 | - legacyDividerMenu.showDivider = true |
1300 | - compare(legacyDividerMenu.divider.visible, true) |
1301 | - compare(legacyDividerMenu.showDivider, true) |
1302 | + } |
1303 | + |
1304 | + function test_noMenuHeight() { |
1305 | + compare(baseMenu.height > baseMenu.menuHeight, true) |
1306 | + } |
1307 | + |
1308 | + function test_dividerMenuHeight() { |
1309 | + menuHeightMenu.divider.visible = true |
1310 | + compare(menuHeightMenu.height, menuHeightMenu.menuHeight + dividerMenu.divider.height) |
1311 | + } |
1312 | + |
1313 | + function test_noDividerMenuHeight() { |
1314 | + menuHeightMenu.divider.visible = false |
1315 | + compare(menuHeightMenu.height, menuHeightMenu.menuHeight) |
1316 | } |
1317 | |
1318 | function test_clickEvent() { |
1319 | @@ -178,5 +187,13 @@ |
1320 | mouseClick(removeAction, removeAction.width/2, removeAction.height/2) |
1321 | tryCompare(signalSpy, "count", 1) |
1322 | } |
1323 | + |
1324 | + function test_pointerMode() { |
1325 | + compare(pointerModeMenu.menuStyle, PointerStyle, "menuStyle doesn't match Pointer") |
1326 | + } |
1327 | + |
1328 | + function test_touchMode() { |
1329 | + compare(touchModeMenu.menuStyle, TouchStyle, "menuStyle doesn't match Touch") |
1330 | + } |
1331 | } |
1332 | } |
1333 | |
1334 | === modified file 'tests/qmltests/Menus/tst_ButtonMenu.qml' |
1335 | --- tests/qmltests/Menus/tst_ButtonMenu.qml 2016-02-11 11:23:02 +0000 |
1336 | +++ tests/qmltests/Menus/tst_ButtonMenu.qml 2016-10-28 10:23:24 +0000 |
1337 | @@ -53,24 +53,45 @@ |
1338 | } |
1339 | |
1340 | SignalSpy { |
1341 | - id: signalSpy |
1342 | + id: menuItemClickSpy |
1343 | + target: buttonMenu |
1344 | signalName: "clicked" |
1345 | + } |
1346 | + |
1347 | + SignalSpy { |
1348 | + id: buttonClickSpy |
1349 | target: buttonMenu |
1350 | + signalName: "buttonClicked" |
1351 | } |
1352 | |
1353 | UbuntuTestCase { |
1354 | name: "ButtonMenu" |
1355 | when: windowShown |
1356 | |
1357 | + property var button |
1358 | + property var button2 |
1359 | + |
1360 | + function init() { |
1361 | + menuItemClickSpy.clear() |
1362 | + buttonClickSpy.clear() |
1363 | + |
1364 | + button = findChild(buttonMenu, "button"); |
1365 | + button2 = findChild(buttonMenu2, "button"); |
1366 | + |
1367 | + verify(button !== undefined); |
1368 | + verify(button2 !== undefined); |
1369 | + } |
1370 | + |
1371 | function test_click() { |
1372 | - signalSpy.clear(); |
1373 | - |
1374 | - var button = findChild(buttonMenu, "button"); |
1375 | - var button2 = findChild(buttonMenu2, "button"); |
1376 | - verify(button !== undefined); |
1377 | - |
1378 | mouseClick(button, button.width / 2, button.height / 2); |
1379 | - compare(signalSpy.count > 0, true, "signal clicked not triggered"); |
1380 | + compare(menuItemClickSpy.count, 1, "signal clicked not triggered"); |
1381 | + compare(buttonClickSpy.count, 1, "button signal clicked not triggered"); |
1382 | + } |
1383 | + |
1384 | + function test_clickOnItem() { |
1385 | + mouseClick(buttonMenu, 1, button.height / 2); |
1386 | + compare(menuItemClickSpy.count, 1, "signal clicked not triggered"); |
1387 | + compare(buttonClickSpy.count, 0, "button signal clicked triggered"); |
1388 | } |
1389 | } |
1390 | } |
FAILED: Continuous integration, rev:281 /unity8- jenkins. ubuntu. com/job/ lp-ubuntu- settings- components- ci/81/ /unity8- jenkins. ubuntu. com/job/ build/3037 /unity8- jenkins. ubuntu. com/job/ test-0- autopkgtest/ label=amd64, release= vivid+overlay, testname= qmluitests. sh/1684 /unity8- jenkins. ubuntu. com/job/ test-0- autopkgtest/ label=amd64, release= xenial+ overlay, testname= qmluitests. sh/1684 /unity8- jenkins. ubuntu. com/job/ test-0- autopkgtest/ label=amd64, release= yakkety, testname= qmluitests. sh/1684 /unity8- jenkins. ubuntu. com/job/ build-0- fetch/3065 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 2922 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 2922/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 2922 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 2922/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= yakkety/ 2922 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= yakkety/ 2922/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 2922 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 2922/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 2922 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 2922/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= yakkety/ 2922 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= yakkety/ 2922/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 2922 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 2922/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 2922 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 2922/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= yakkety/ 2922 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= yakkety/ 2922/artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-ubuntu- settings- components- ci/81/rebuild
https:/