Merge lp:~zsombi/ubuntu-ui-toolkit/paleette2 into lp:ubuntu-ui-toolkit/staging

Proposed by Zsombor Egri on 2016-01-22
Status: Merged
Approved by: Zsombor Egri on 2016-01-27
Approved revision: 1837
Merged at revision: 1824
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/paleette2
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 1570 lines (+383/-186)
51 files modified
components.api (+5/-2)
examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml (+1/-0)
src/Ubuntu/Components/1.3/OptionSelector.qml (+2/-1)
src/Ubuntu/Components/1.3/PageHeadConfiguration.qml (+2/-2)
src/Ubuntu/Components/1.3/TextField.qml (+1/-1)
src/Ubuntu/Components/1.3/UbuntuColors.qml (+2/-2)
src/Ubuntu/Components/ListItems/1.3/Empty.qml (+3/-1)
src/Ubuntu/Components/ListItems/1.3/LabelVisual.qml (+3/-3)
src/Ubuntu/Components/ListItems/1.3/Standard.qml (+2/-2)
src/Ubuntu/Components/Popups/1.3/Dialog.qml (+3/-3)
src/Ubuntu/Components/Themes/1.3/Palette.qml (+12/-4)
src/Ubuntu/Components/Themes/1.3/PaletteValues.qml (+12/-1)
src/Ubuntu/Components/Themes/Ambiance/1.3/AmbianceNormal.qml (+5/-3)
src/Ubuntu/Components/Themes/Ambiance/1.3/AmbianceSelected.qml (+27/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml (+13/-5)
src/Ubuntu/Components/Themes/Ambiance/1.3/BubbleShape.qml (+5/-36)
src/Ubuntu/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml (+7/-3)
src/Ubuntu/Components/Themes/Ambiance/1.3/DatePickerStyle.qml (+1/-1)
src/Ubuntu/Components/Themes/Ambiance/1.3/DialerStyle.qml (+13/-11)
src/Ubuntu/Components/Themes/Ambiance/1.3/DialogForegroundStyle.qml (+2/-2)
src/Ubuntu/Components/Themes/Ambiance/1.3/FocusShape.qml (+4/-2)
src/Ubuntu/Components/Themes/Ambiance/1.3/IconButtonStyle.qml (+6/-6)
src/Ubuntu/Components/Themes/Ambiance/1.3/ListItemStyle.qml (+6/-4)
src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml (+21/-2)
src/Ubuntu/Components/Themes/Ambiance/1.3/OverflowPanel.qml (+4/-4)
src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml (+11/-5)
src/Ubuntu/Components/Themes/Ambiance/1.3/Palette.qml (+21/-13)
src/Ubuntu/Components/Themes/Ambiance/1.3/PickerStyle.qml (+2/-2)
src/Ubuntu/Components/Themes/Ambiance/1.3/PopoverForegroundStyle.qml (+4/-1)
src/Ubuntu/Components/Themes/Ambiance/1.3/ProgressBarStyle.qml (+12/-4)
src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml (+10/-8)
src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml (+8/-5)
src/Ubuntu/Components/Themes/Ambiance/1.3/SliderStyle.qml (+3/-3)
src/Ubuntu/Components/Themes/Ambiance/1.3/SwitchStyle.qml (+3/-3)
src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml (+5/-5)
src/Ubuntu/Components/Themes/Ambiance/1.3/TextCursorStyle.qml (+3/-3)
src/Ubuntu/Components/Themes/Ambiance/1.3/ToolbarButtonStyle.qml (+8/-9)
src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro (+1/-0)
src/Ubuntu/Components/Themes/SuruDark/1.3/Palette.qml (+22/-13)
src/Ubuntu/Components/Themes/SuruDark/1.3/SuruDarkNormal.qml (+5/-3)
src/Ubuntu/Components/Themes/SuruDark/1.3/SuruDarkSelected.qml (+29/-0)
src/Ubuntu/Components/Themes/SuruDark/SuruDark.pro (+1/-0)
src/Ubuntu/Components/plugin/privates/threelabelsslot_p.cpp (+19/-2)
src/Ubuntu/Components/plugin/privates/threelabelsslot_p.h (+4/-0)
src/Ubuntu/Components/plugin/ucbottomedge.cpp (+4/-0)
src/Ubuntu/Components/plugin/uclabel.cpp (+23/-4)
src/Ubuntu/Components/plugin/uclabel.h (+6/-0)
src/Ubuntu/Components/plugin/uclistitem.cpp (+1/-1)
tests/unit_x11/tst_bottomedge/tst_bottomedge.cpp (+8/-0)
tests/unit_x11/tst_components/AppTheme/Palette.qml (+1/-1)
tests/unit_x11/tst_components/tst_slotslayout.qml (+7/-0)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/paleette2
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve on 2016-01-27
Tim Peeters Approve on 2016-01-27
Christian Dywan (community) 2016-01-22 Approve on 2016-01-27
Zoltan Balogh (community) Approve on 2016-01-27
Review via email: mp+283686@code.launchpad.net

Commit message

Palette fix. Update components to use the palette.

Description of the change

Palette fix. Update components to use the palette.

To post a comment you must log in.
review: Needs Fixing (continuous-integration)
review: Needs Fixing (continuous-integration)
review: Needs Fixing (continuous-integration)
1831. By Zsombor Egri on 2016-01-27

ListItemLatout label default coloring

Christian Dywan (kalikiana) wrote :

+++ src/Ubuntu/Components/plugin/ucbottomedge.cpp 2016-01-27 06:39:19 +0000
+++ tests/unit_x11/tst_bottomedge/tst_bottomedge.cpp 2016-01-27 06:39:19 +0000

Unrelated? Probably better in a separate branch?

+ d->m_subtitle = new UCLabel(getSubtitleColor, this);

You're passing a method so the Label gets to evaluate the color lambda-style. But UCLabel.m_defaultColor is right now only called in postThemeChanged. To make this really work you'll also need (the equivalent of) onEnabledChanged and onActiveFocusChanged.
I like the idea, but I feel this should be done cleaner...

This might be the right time to fill a gap in our API. I think we already agree we need state-based colors in some form.

How about getPaletteColor returning a UCPaletteColor(QQuickItem* item, const QString& color) object that has a color based on activeFocus and enabled, so UCLabel just needs to listen to colorChanged?
This would kind of enforce consistent use of the palette, and even states which UCLabel doesn't currently implement, but I think that would be a good thing.

review: Needs Information
1832. By Zsombor Egri on 2016-01-27

Scrollbar colors fixed

Zsombor Egri (zsombi) wrote :

> +++ src/Ubuntu/Components/plugin/ucbottomedge.cpp 2016-01-27 06:39:19
> +0000
> +++ tests/unit_x11/tst_bottomedge/tst_bottomedge.cpp 2016-01-27 06:39:19
> +0000
>
> Unrelated? Probably better in a separate branch?

As we discussed, I had to do code change in the BottomEdge, so I thought it would be wiser to also add a test to it. The coloring wasn't working otherwise.

>
>
> + d->m_subtitle = new UCLabel(getSubtitleColor, this);
>
> You're passing a method so the Label gets to evaluate the color lambda-style.
> But UCLabel.m_defaultColor is right now only called in postThemeChanged. To
> make this really work you'll also need (the equivalent of) onEnabledChanged
> and onActiveFocusChanged.
> I like the idea, but I feel this should be done cleaner...

You are right, the enabled must also be handled.

>
> This might be the right time to fill a gap in our API. I think we already
> agree we need state-based colors in some form.
>
> How about getPaletteColor returning a UCPaletteColor(QQuickItem* item, const
> QString& color) object that has a color based on activeFocus and enabled, so
> UCLabel just needs to listen to colorChanged?
> This would kind of enforce consistent use of the palette, and even states
> which UCLabel doesn't currently implement, but I think that would be a good
> thing.

Summarizing of what we discussed, we need a code which selects the color from the proper valueset, however that must be based on enabled and "selected" notion rather than enabled and activeFocus. The selected valueset should only be used if the item has the ability to do that. And we need to decide what will be the criteria. I'd rather do this in a separate MR than in this one. But we can agree on that in the standup.

review: Needs Fixing (continuous-integration)
1833. By Zsombor Egri on 2016-01-27

OptionSelector and ListItem.Empty

1834. By Zsombor Egri on 2016-01-27

introducing highlighted valueset; changing inactive into disabled, selectedInactive into selectedDisabled; update components

1835. By Zsombor Egri on 2016-01-27

remove pointer from Popover, shoudl come back when UbuntuShape will have support for it

1836. By Zsombor Egri on 2016-01-27

refresh default color for Label also when enabled changes

Zoltan Balogh (bzoltan) wrote :

I like it, let's see it in the silo

review: Approve
1837. By Zsombor Egri on 2016-01-27

fix opacity used for disabled state

Christian Dywan (kalikiana) wrote :

> Summarizing of what we discussed, we need a code which selects the color from
> the proper valueset, however that must be based on enabled and "selected"
> notion rather than enabled and activeFocus. The selected valueset should only
> be used if the item has the ability to do that. And we need to decide what
> will be the criteria. I'd rather do this in a separate MR than in this one.
> But we can agree on that in the standup.

Yeah, as agreed we can iterate it later; enabled is now handled and that's enough for what we need here.
Things are looking a lot better with all the fixes!

review: Approve
Tim Peeters (tpeeters) wrote :

Looks fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components.api'
2--- components.api 2016-01-21 14:42:35 +0000
3+++ components.api 2016-01-27 16:42:56 +0000
4@@ -852,10 +852,11 @@
5 property PaletteValues normal
6 property PaletteValues selected
7 Ubuntu.Components.Themes.Palette 1.3: QtObject
8- property PaletteValues inactive
9+ property PaletteValues disabled
10+ property PaletteValues highlighted
11 property PaletteValues normal
12 property PaletteValues selected
13- property PaletteValues selectedInactive
14+ property PaletteValues selectedDisabled
15 Ubuntu.Components.Themes.PaletteValues 0.1: QtObject
16 property color background
17 property color backgroundText
18@@ -879,6 +880,8 @@
19 property color baseText
20 property color field
21 property color fieldText
22+ property color focus
23+ property color focusText
24 property color foreground
25 property color foregroundText
26 property color negative
27
28=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml'
29--- examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml 2015-11-10 11:53:53 +0000
30+++ examples/ubuntu-ui-toolkit-gallery/ListItemLayouts.qml 2016-01-27 16:42:56 +0000
31@@ -79,6 +79,7 @@
32 id: telegramContactsLayout
33 title.text: "Telegram Name goes here"
34 subtitle.text: "last seen 12:02"
35+ summary.text: "Oh wow! What a nice layout!"
36
37 Rectangle {
38 id: imageShape
39
40=== modified file 'src/Ubuntu/Components/1.3/OptionSelector.qml'
41--- src/Ubuntu/Components/1.3/OptionSelector.qml 2015-09-28 14:36:54 +0000
42+++ src/Ubuntu/Components/1.3/OptionSelector.qml 2016-01-27 16:42:56 +0000
43@@ -216,7 +216,7 @@
44
45 readonly property url chevron: __styleInstance.chevron
46 readonly property url tick: __styleInstance.tick
47- readonly property color themeColour: theme.palette.selected.fieldText
48+ readonly property color themeColour: theme.palette.normal.backgroundText
49 readonly property alias colourImage: optionSelector.colourImage
50 property bool currentlyExpanded: expanded || multiSelection
51
52@@ -264,6 +264,7 @@
53
54 ListView {
55 id: list
56+ parent: listContainer.__styleInstance.content
57
58 property int previousIndex: -1
59 readonly property alias expanded: optionSelector.expanded
60
61=== modified file 'src/Ubuntu/Components/1.3/PageHeadConfiguration.qml'
62--- src/Ubuntu/Components/1.3/PageHeadConfiguration.qml 2015-10-01 12:54:32 +0000
63+++ src/Ubuntu/Components/1.3/PageHeadConfiguration.qml 2016-01-27 16:42:56 +0000
64@@ -1,5 +1,5 @@
65 /*
66- * Copyright 2015 Canonical Ltd.
67+ * Copyright 2016 Canonical Ltd.
68 *
69 * This program is free software; you can redistribute it and/or modify
70 * it under the terms of the GNU Lesser General Public License as published by
71@@ -50,7 +50,7 @@
72 PageHeadSections {
73 id: headSections
74 }
75- property color foregroundColor: theme.palette.selected.backgroundText
76+ property color foregroundColor: theme.palette.normal.backgroundText
77
78 property bool locked: false
79
80
81=== modified file 'src/Ubuntu/Components/1.3/TextField.qml'
82--- src/Ubuntu/Components/1.3/TextField.qml 2016-01-26 09:56:34 +0000
83+++ src/Ubuntu/Components/1.3/TextField.qml 2016-01-27 16:42:56 +0000
84@@ -982,7 +982,7 @@
85 }
86 // hint is shown till user types something in the field
87 visible: (editor.text == "") && !editor.inputMethodComposing
88- color: theme.palette.normal.base
89+ color: theme.palette.normal.baseText
90 font: editor.font
91 elide: Text.ElideRight
92 }
93
94=== modified file 'src/Ubuntu/Components/1.3/UbuntuColors.qml'
95--- src/Ubuntu/Components/1.3/UbuntuColors.qml 2016-01-13 16:07:58 +0000
96+++ src/Ubuntu/Components/1.3/UbuntuColors.qml 2016-01-27 16:42:56 +0000
97@@ -1,5 +1,5 @@
98 /*
99- Copyright 2014 Canonical Ltd.
100+ Copyright 2016 Canonical Ltd.
101 *
102 This program is free software; you can redistribute it and/or modify
103 it under the terms of the GNU Lesser General Public License as published by
104@@ -177,5 +177,5 @@
105 Jet. Recommended for content coloring.
106 \since Ubuntu.Components 1.3
107 */
108- readonly property color jet: "#292929"
109+ readonly property color jet: "#111111"
110 }
111
112=== modified file 'src/Ubuntu/Components/ListItems/1.3/Empty.qml'
113--- src/Ubuntu/Components/ListItems/1.3/Empty.qml 2015-09-21 14:44:13 +0000
114+++ src/Ubuntu/Components/ListItems/1.3/Empty.qml 2016-01-27 16:42:56 +0000
115@@ -277,6 +277,8 @@
116 }
117 }
118
119+ // exposed for OptionSelector
120+ property alias __highlight: highlight
121 Rectangle {
122 id: highlight
123
124@@ -291,7 +293,7 @@
125 top: parent.top
126 }
127 height: emptyListItem.height - bottomDividerLine.height
128- color: theme.palette.selected.background
129+ color: theme.palette.highlighted.background
130 }
131
132 ThinDivider {
133
134=== modified file 'src/Ubuntu/Components/ListItems/1.3/LabelVisual.qml'
135--- src/Ubuntu/Components/ListItems/1.3/LabelVisual.qml 2016-01-14 15:10:44 +0000
136+++ src/Ubuntu/Components/ListItems/1.3/LabelVisual.qml 2016-01-27 16:42:56 +0000
137@@ -32,11 +32,11 @@
138
139 elide: Text.ElideRight
140 color: selected
141- ? UbuntuColors.orange
142+ ? theme.palette.selected.backgroundText
143 : (secondary
144 ? (overlay
145- ? theme.palette.normal.overlayText
146- : theme.palette.normal.backgroundText)
147+ ? theme.palette.normal.overlaySecondaryText
148+ : theme.palette.normal.backgroundSecondaryText)
149 : (overlay
150 ? theme.palette.normal.overlayText
151 : theme.palette.normal.backgroundText))
152
153=== modified file 'src/Ubuntu/Components/ListItems/1.3/Standard.qml'
154--- src/Ubuntu/Components/ListItems/1.3/Standard.qml 2015-12-21 19:43:34 +0000
155+++ src/Ubuntu/Components/ListItems/1.3/Standard.qml 2016-01-27 16:42:56 +0000
156@@ -172,7 +172,7 @@
157 bottom: parent.bottom
158 left: parent.left
159 }
160- color: theme.palette.selected.background
161+ color: theme.palette.highlighted.background
162 }
163
164 Rectangle {
165@@ -185,7 +185,7 @@
166 bottom: parent.bottom
167 right: parent.right
168 }
169- color: theme.palette.selected.background
170+ color: theme.palette.highlighted.background
171 }
172
173 IconVisual {
174
175=== modified file 'src/Ubuntu/Components/Popups/1.3/Dialog.qml'
176--- src/Ubuntu/Components/Popups/1.3/Dialog.qml 2016-01-13 16:07:58 +0000
177+++ src/Ubuntu/Components/Popups/1.3/Dialog.qml 2016-01-27 16:42:56 +0000
178@@ -1,5 +1,5 @@
179 /*
180- * Copyright 2015 Canonical Ltd.
181+ * Copyright 2016 Canonical Ltd.
182 *
183 * This program is free software; you can redistribute it and/or modify
184 * it under the terms of the GNU Lesser General Public License as published by
185@@ -194,14 +194,14 @@
186 maximumLineCount: 2
187 elide: Text.ElideRight
188 textSize: Label.Large
189- color: UbuntuColors.slate
190+ color: theme.palette.normal.overlayText
191 visible: (text !== "")
192 }
193
194 Label {
195 horizontalAlignment: Text.AlignHCenter
196 text: dialog.text
197- color: UbuntuColors.slate
198+ color: theme.palette.normal.overlayText
199 wrapMode: Text.Wrap
200 visible: (text !== "")
201 }
202
203=== modified file 'src/Ubuntu/Components/Themes/1.3/Palette.qml'
204--- src/Ubuntu/Components/Themes/1.3/Palette.qml 2015-11-30 10:05:54 +0000
205+++ src/Ubuntu/Components/Themes/1.3/Palette.qml 2016-01-27 16:42:56 +0000
206@@ -53,9 +53,11 @@
207 property PaletteValues normal: PaletteValues{}
208
209 /*!
210- Color palette to use when the widget is in the inactive (disabled) state.
211+ Color palette to use when the widget is in the disabled (enabled: false)
212+ state.
213+ \since Ubuntu.Components.Themes 1.3
214 */
215- property PaletteValues inactive: PaletteValues{}
216+ property PaletteValues disabled: PaletteValues{}
217
218 /*!
219 Color palette to use when the widget is selected, for example when
220@@ -64,8 +66,14 @@
221 property PaletteValues selected: PaletteValues{}
222
223 /*!
224- Color palette values to use when the widget is selected and inactive.
225+ Color palette to use when the widget is selected and disabled.
226+ \since Ubuntu.Components.Themes 1.3
227+ */
228+ property PaletteValues selectedDisabled: PaletteValues{}
229+
230+ /*!
231+ Color palette values to use when the widget is highlighted.
232 \since Ubuntu.Components.Themes 1.3
233 */
234- property PaletteValues selectedInactive: PaletteValues{}
235+ property PaletteValues highlighted: PaletteValues{}
236 }
237
238=== modified file 'src/Ubuntu/Components/Themes/1.3/PaletteValues.qml'
239--- src/Ubuntu/Components/Themes/1.3/PaletteValues.qml 2015-11-30 13:15:10 +0000
240+++ src/Ubuntu/Components/Themes/1.3/PaletteValues.qml 2016-01-27 16:42:56 +0000
241@@ -1,5 +1,5 @@
242 /*
243- * Copyright 2013 Canonical Ltd.
244+ * Copyright 2016 Canonical Ltd.
245 *
246 * This program is free software; you can redistribute it and/or modify
247 * it under the terms of the GNU Lesser General Public License as published by
248@@ -148,4 +148,15 @@
249 \since Ubuntu.Components.Themes 1.3
250 */
251 property color selectionText
252+
253+ /*!
254+ Color applied for the focus frame drawn around the active focus component
255+ if it was focused using keyboard navigation.
256+ */
257+ property color focus
258+
259+ /*!
260+ Color applied to elements placed on top of the \l focus color.
261+ */
262+ property color focusText
263 }
264
265=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/AmbianceNormal.qml'
266--- src/Ubuntu/Components/Themes/Ambiance/1.3/AmbianceNormal.qml 2016-01-13 16:07:58 +0000
267+++ src/Ubuntu/Components/Themes/Ambiance/1.3/AmbianceNormal.qml 2016-01-27 16:42:56 +0000
268@@ -1,5 +1,5 @@
269 /*
270- * Copyright 2015 Canonical Ltd.
271+ * Copyright 2016 Canonical Ltd.
272 *
273 * This program is free software; you can redistribute it and/or modify
274 * it under the terms of the GNU Lesser General Public License as published by
275@@ -24,7 +24,7 @@
276 backgroundSecondaryText: UbuntuColors.slate
277 backgroundTertiaryText: UbuntuColors.ash
278 base: UbuntuColors.silk
279- baseText: UbuntuColors.slate
280+ baseText: UbuntuColors.ash
281 foreground: UbuntuColors.porcelain
282 foregroundText: UbuntuColors.jet
283 raised: "#FFFFFF"
284@@ -35,7 +35,9 @@
285 overlaySecondaryText: UbuntuColors.silk
286 field: "#FFFFFF"
287 fieldText: UbuntuColors.jet
288- selection: Qt.rgba(UbuntuColors.orange.r, UbuntuColors.orange.g, UbuntuColors.orange.b, 0.2)
289+ focus: UbuntuColors.orange
290+ focusText: "#FFFFFF"
291+ selection: Qt.rgba(UbuntuColors.blue.r, UbuntuColors.blue.g, UbuntuColors.blue.b, 0.2)
292 selectionText: UbuntuColors.jet
293 positive: UbuntuColors.green
294 positiveText: "#FFFFFF"
295
296=== added file 'src/Ubuntu/Components/Themes/Ambiance/1.3/AmbianceSelected.qml'
297--- src/Ubuntu/Components/Themes/Ambiance/1.3/AmbianceSelected.qml 1970-01-01 00:00:00 +0000
298+++ src/Ubuntu/Components/Themes/Ambiance/1.3/AmbianceSelected.qml 2016-01-27 16:42:56 +0000
299@@ -0,0 +1,27 @@
300+/*
301+ * Copyright 2016 Canonical Ltd.
302+ *
303+ * This program is free software; you can redistribute it and/or modify
304+ * it under the terms of the GNU Lesser General Public License as published by
305+ * the Free Software Foundation; version 3.
306+ *
307+ * This program is distributed in the hope that it will be useful,
308+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
309+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
310+ * GNU Lesser General Public License for more details.
311+ *
312+ * You should have received a copy of the GNU Lesser General Public License
313+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
314+ */
315+
316+import QtQuick 2.4
317+import Ubuntu.Components 1.3
318+
319+AmbianceNormal {
320+ background: UbuntuColors.porcelain
321+ backgroundText: UbuntuColors.blue
322+ backgroundTertiaryText: UbuntuColors.blue
323+ base: UbuntuColors.ash
324+ baseText: UbuntuColors.blue
325+ foreground: UbuntuColors.ash
326+}
327
328=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml'
329--- src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml 2016-01-13 17:31:54 +0000
330+++ src/Ubuntu/Components/Themes/Ambiance/1.3/BottomEdgeHintStyle.qml 2016-01-27 16:42:56 +0000
331@@ -1,5 +1,5 @@
332 /*
333- * Copyright 2015 Canonical Ltd.
334+ * Copyright 2016 Canonical Ltd.
335 *
336 * This program is free software; you can redistribute it and/or modify
337 * it under the terms of the GNU Lesser General Public License as published by
338@@ -25,6 +25,14 @@
339
340 readonly property BottomEdgeHint hint: styledItem
341
342+ property color backgroundColor: styledItem.enabled
343+ ? theme.palette.normal.overlay
344+ : theme.palette.disabled.overlay
345+
346+ property color foregroundColor: styledItem.enabled
347+ ? theme.palette.normal.overlayText
348+ : theme.palette.disabled.overlayText
349+
350 // translate hint status into state
351 state: {
352 switch (hint.status) {
353@@ -103,7 +111,7 @@
354 topMargin: styledItem.height
355 }
356 name: "toolkit_bottom-edge-hint"
357- color: theme.palette.normal.overlayText
358+ color: foregroundColor
359 }
360
361 Rectangle {
362@@ -115,7 +123,7 @@
363 topMargin: styledItem.height
364 }
365 height: styledItem.height
366- color: theme.palette.normal.overlay
367+ color: backgroundColor
368 ThinDivider {
369 anchors.top: parent.top
370 }
371@@ -134,13 +142,13 @@
372 width: height
373 height: units.gu(2)
374 anchors.verticalCenter: parent.verticalCenter
375- color: theme.palette.normal.overlayText
376+ color: foregroundColor
377 }
378 Label {
379 id: label
380 text: styledItem.text
381 textSize: Label.Medium
382- color: theme.palette.normal.overlayText
383+ color: foregroundColor
384 height: styledItem.height
385 anchors.verticalCenter: parent.verticalCenter
386 verticalAlignment: Text.AlignVCenter
387
388=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/BubbleShape.qml'
389--- src/Ubuntu/Components/Themes/Ambiance/1.3/BubbleShape.qml 2015-12-04 09:52:05 +0000
390+++ src/Ubuntu/Components/Themes/Ambiance/1.3/BubbleShape.qml 2016-01-27 16:42:56 +0000
391@@ -1,5 +1,5 @@
392 /*
393- * Copyright 2015 Canonical Ltd.
394+ * Copyright 2016 Canonical Ltd.
395 *
396 * This program is free software; you can redistribute it and/or modify
397 * it under the terms of the GNU Lesser General Public License as published by
398@@ -28,15 +28,14 @@
399 /*!
400 The background color of the bubble.
401 */
402- property color color: square ? theme.palette.normal.background : theme.palette.normal.raised
403+ property color color: square
404+ ? theme.palette.normal.background
405+ : theme.palette.normal.overlay
406
407 property point target
408 property string direction: "down"
409 property bool clipContent: false
410 default property alias children: content.children
411- // FIXME: This should not be necessary. See
412- // https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1214978
413- property alias arrowSource: arrow.source
414
415 implicitWidth: units.gu(10)
416 implicitHeight: units.gu(8)
417@@ -111,7 +110,7 @@
418 UbuntuShape {
419 anchors.fill: parent
420 aspect: UbuntuShape.Flat
421- backgroundColor: theme.palette.normal.raised
422+ backgroundColor: bubbleShape.color
423 source: bubbleShape.clipContent ? shapeSource : null
424 visible: !square
425 }
426@@ -139,34 +138,4 @@
427 visible: bubbleShape.clipContent
428 }
429 }
430-
431- Item {
432- x: target.x
433- y: target.y
434-
435- Image {
436- id: arrow
437-
438- visible: !square && bubbleShape.direction != "none"
439-
440- function directionToRotation(direction) {
441- switch (direction) {
442- case "up":
443- return 180;
444- case "left":
445- return 90;
446- case "right":
447- return -90;
448- default: // "down" or "none"
449- return 0;
450- }
451- }
452-
453- x: -width / 2.0
454- y: -height
455- transformOrigin: Item.Bottom
456- rotation: directionToRotation(bubbleShape.direction)
457- source: Qt.resolvedUrl("../artwork/bubble_arrow.png")
458- }
459- }
460 }
461
462=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml'
463--- src/Ubuntu/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml 2016-01-13 14:25:22 +0000
464+++ src/Ubuntu/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml 2016-01-27 16:42:56 +0000
465@@ -30,12 +30,14 @@
466 */
467 property color uncheckedBackgroundColor: styledItem.enabled
468 ? theme.palette.normal.foreground
469- : theme.palette.inactive.foreground
470+ : theme.palette.disabled.foreground
471
472 /*!
473 The background color when the checkbox is checked.
474 */
475- property color checkedBackgroundColor: styledItem.enabled ? theme.palette.normal.positive : theme.palette.inactive.raised
476+ property color checkedBackgroundColor: styledItem.enabled
477+ ? theme.palette.normal.positive
478+ : theme.palette.disabled.raised
479
480 /*!
481 The image to show inside the checkbox when it is checked.
482@@ -45,7 +47,9 @@
483 /*!
484 The color of the icon.
485 */
486- property color iconColor: styledItem.enabled ? theme.palette.normal.positiveText : theme.palette.inactive.raisedText
487+ property color iconColor: styledItem.enabled
488+ ? theme.palette.normal.positiveText
489+ : theme.palette.disabled.raisedText
490
491 /*!
492 The padding between the icon and the border of the thumb.
493
494=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/DatePickerStyle.qml'
495--- src/Ubuntu/Components/Themes/Ambiance/1.3/DatePickerStyle.qml 2015-07-22 13:14:43 +0000
496+++ src/Ubuntu/Components/Themes/Ambiance/1.3/DatePickerStyle.qml 2016-01-27 16:42:56 +0000
497@@ -32,7 +32,7 @@
498 /*!
499 Highlight color.
500 */
501- property color highlightColor: UbuntuColors.orange
502+ property color highlightColor: theme.palette.highlight.baseText
503 /*!
504 Scale of the highlight item
505 */
506
507=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/DialerStyle.qml'
508--- src/Ubuntu/Components/Themes/Ambiance/1.3/DialerStyle.qml 2015-04-25 07:36:13 +0000
509+++ src/Ubuntu/Components/Themes/Ambiance/1.3/DialerStyle.qml 2016-01-27 16:42:56 +0000
510@@ -1,5 +1,5 @@
511 /*
512- * Copyright 2013 Canonical Ltd.
513+ * Copyright 2016 Canonical Ltd.
514 *
515 * This program is free software; you can redistribute it and/or modify
516 * it under the terms of the GNU Lesser General Public License as published by
517@@ -26,12 +26,14 @@
518
519 property real offset : units.gu(0.2)
520
521+ property color dialerColor: theme.palette.normal.base
522+
523 gradient: Gradient {
524- GradientStop { position: 0.0; color: "#512F48" }
525- GradientStop { position: 0.25; color: "#583048" }
526- GradientStop { position: 0.5; color: "#653449" }
527- GradientStop { position: 0.75; color: "#6D384A" }
528- GradientStop { position: 1.0; color: "#753B4A" }
529+ GradientStop { position: 0.0; color: dialerColor }
530+ GradientStop { position: 0.25; color: Qt.darker(dialerColor, 1.0) }
531+ GradientStop { position: 0.5; color: Qt.darker(dialerColor, 1.1) }
532+ GradientStop { position: 0.75; color: Qt.darker(dialerColor, 1.2) }
533+ GradientStop { position: 1.0; color: Qt.darker(dialerColor, 1.3) }
534 }
535 // draws the outter shadow/highlight
536 Rectangle {
537@@ -79,11 +81,11 @@
538 antialiasing: true;
539
540 gradient: Gradient {
541- GradientStop { position: 0.0; color: "#7A4C68" }
542- GradientStop { position: 0.25; color: "#804563" }
543- GradientStop { position: 0.5; color: "#864660" }
544- GradientStop { position: 0.75; color: "#86465E" }
545- GradientStop { position: 1.0; color: "#964E66" }
546+ GradientStop { position: 0.0; color: dialerColor }
547+ GradientStop { position: 0.25; color: Qt.darker(dialerColor, 1.0) }
548+ GradientStop { position: 0.5; color: Qt.darker(dialerColor, 1.1) }
549+ GradientStop { position: 0.75; color: Qt.darker(dialerColor, 1.2) }
550+ GradientStop { position: 1.0; color: Qt.darker(dialerColor, 1.3) }
551 }
552
553 // draws the inner highlight / shadow
554
555=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/DialogForegroundStyle.qml'
556--- src/Ubuntu/Components/Themes/Ambiance/1.3/DialogForegroundStyle.qml 2015-07-22 13:14:43 +0000
557+++ src/Ubuntu/Components/Themes/Ambiance/1.3/DialogForegroundStyle.qml 2016-01-27 16:42:56 +0000
558@@ -1,5 +1,5 @@
559 /*
560- * Copyright 2013 Canonical Ltd.
561+ * Copyright 2016 Canonical Ltd.
562 *
563 * This program is free software; you can redistribute it and/or modify
564 * it under the terms of the GNU Lesser General Public License as published by
565@@ -23,6 +23,6 @@
566 UbuntuShape {
567 id: background
568 anchors.fill: parent
569- backgroundColor: "white"
570+ backgroundColor: theme.palette.normal.overlay
571 }
572 }
573
574=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/FocusShape.qml'
575--- src/Ubuntu/Components/Themes/Ambiance/1.3/FocusShape.qml 2016-01-21 15:44:40 +0000
576+++ src/Ubuntu/Components/Themes/Ambiance/1.3/FocusShape.qml 2016-01-27 16:42:56 +0000
577@@ -1,5 +1,5 @@
578 /*
579- * Copyright 2015 Canonical Ltd.
580+ * Copyright 2016 Canonical Ltd.
581 *
582 * This program is free software; you can redistribute it and/or modify
583 * it under the terms of the GNU Lesser General Public License as published by
584@@ -23,7 +23,9 @@
585 Frame {
586 anchors.fill: parent
587 anchors.margins: -units.gu(0.46)
588- color: UbuntuColors.orange // FIXME: Use color from palette
589+ color: styledItem.enabled
590+ ? theme.palette.normal.focus
591+ : theme.palette.disabled.focus
592 thickness: units.gu(0.21)
593 radius: units.gu(1.7)
594 visible: styledItem.keyNavigationFocus
595
596=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/IconButtonStyle.qml'
597--- src/Ubuntu/Components/Themes/Ambiance/1.3/IconButtonStyle.qml 2016-01-13 14:25:22 +0000
598+++ src/Ubuntu/Components/Themes/Ambiance/1.3/IconButtonStyle.qml 2016-01-27 16:42:56 +0000
599@@ -1,5 +1,5 @@
600 /*
601- * Copyright 2015 Canonical Ltd.
602+ * Copyright 2016 Canonical Ltd.
603 *
604 * This program is free software; you can redistribute it and/or modify
605 * it under the terms of the GNU Lesser General Public License as published by
606@@ -28,13 +28,13 @@
607 */
608 property color foregroundColor: styledItem.enabled
609 ? theme.palette.normal.backgroundText
610- : theme.palette.inactive.backgroundText
611+ : theme.palette.disabled.backgroundText
612
613 /*!
614 The background color of the button.
615 */
616 property color backgroundColor: styledItem.pressed ?
617- theme.palette.selected.background :
618+ theme.palette.highlighted.background :
619 "transparent"
620
621 property real iconWidth: units.gu(2)
622@@ -45,9 +45,6 @@
623 */
624 property bool showLabel: false
625
626- FocusShape {
627- }
628-
629 Rectangle {
630 id: background
631 color: iconButtonStyle.backgroundColor
632@@ -61,6 +58,9 @@
633 height: iconButtonStyle.iconHeight
634 source: styledItem.iconSource
635 color: iconButtonStyle.foregroundColor
636+
637+ FocusShape {
638+ }
639 }
640
641 Component {
642
643=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ListItemStyle.qml'
644--- src/Ubuntu/Components/Themes/Ambiance/1.3/ListItemStyle.qml 2015-12-14 09:16:41 +0000
645+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ListItemStyle.qml 2016-01-27 16:42:56 +0000
646@@ -29,7 +29,8 @@
647 property color trailingPanelColor: theme.palette.normal.foreground
648 property color leadingForegroundColor: theme.palette.normal.negative
649 property color trailingForegroundColor: theme.palette.normal.foregroundText
650-
651+ property color leadingDisabledForegroundColor: theme.palette.disabled.negative
652+ property color trailingDisabledForegroundColor: theme.palette.disabled.foregroundText
653 // anchoring
654 anchors {
655 // do not anchor fill
656@@ -78,7 +79,6 @@
657 id: actionButton
658 action: modelData
659 enabled: action.enabled
660- opacity: action.enabled ? 1.0 : 0.5
661 width: MathUtils.clamp(delegateLoader.item ? delegateLoader.item.width : 0, actionsRow.minItemWidth, actionsRow.maxItemWidth)
662 anchors {
663 top: parent ? parent.top : undefined
664@@ -91,7 +91,7 @@
665
666 Rectangle {
667 anchors.fill: parent
668- color: theme.palette.selected.background
669+ color: theme.palette.highlighted.background
670 visible: pressed
671 }
672
673@@ -122,7 +122,9 @@
674 width: units.gu(2)
675 height: width
676 name: action.iconName
677- color: leading ? leadingForegroundColor : trailingForegroundColor
678+ color: leading
679+ ? (action.enabled ? leadingForegroundColor : leadingDisabledForegroundColor)
680+ : (action.enabled ? trailingForegroundColor : trailingDisabledForegroundColor)
681 anchors.centerIn: parent
682 }
683 }
684
685=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml'
686--- src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml 2015-10-01 19:03:20 +0000
687+++ src/Ubuntu/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml 2016-01-27 16:42:56 +0000
688@@ -25,6 +25,7 @@
689 property url chevron: Qt.resolvedUrl("../artwork/chevron_down.png")
690 property url tick: Qt.resolvedUrl("../artwork/tick.png")
691 property bool colourComponent: true
692+ property alias content: backgroundFrame
693
694 UbuntuShape {
695 id: background
696@@ -32,7 +33,25 @@
697 width: styledItem.width
698 height: styledItem.height
699 radius: "medium"
700-
701- backgroundColor: Qt.rgba(0, 0, 0, 0.05)
702+ source: shapeSource
703+ }
704+
705+ ShaderEffectSource {
706+ id: shapeSource
707+ sourceItem: backgroundFrame
708+ hideSource: true
709+ // FIXME: visible: false prevents rendering so make it a nearly
710+ // transparent 1x1 pixel instead
711+ opacity: 0.01
712+ width: 1
713+ height: 1
714+ }
715+
716+ Rectangle {
717+ id: backgroundFrame
718+ anchors.fill: parent
719+ color: styledItem.enabled
720+ ? theme.palette.normal.background
721+ : theme.palette.disabled.background
722 }
723 }
724
725=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/OverflowPanel.qml'
726--- src/Ubuntu/Components/Themes/Ambiance/1.3/OverflowPanel.qml 2016-01-14 15:10:44 +0000
727+++ src/Ubuntu/Components/Themes/Ambiance/1.3/OverflowPanel.qml 2016-01-27 16:42:56 +0000
728@@ -37,12 +37,14 @@
729 /*!
730 The background color of the tapped item in the panel.
731 */
732- property color highlightColor: theme.palette.selected.background
733+ property color highlightColor: theme.palette.highlighted.background
734
735 /*!
736 The foreground color (icon and text) of actions in the panel.
737 */
738- property color foregroundColor: theme.palette.normal.backgroundText
739+ property color foregroundColor: styledItem.enabled
740+ ? theme.palette.normal.backgroundText
741+ : theme.palette.disabled.backgroundText
742
743 property bool square: true
744 callerMargin: -units.gu(1) + units.dp(4)
745@@ -90,7 +92,6 @@
746 }
747 width: units.gu(2)
748 height: units.gu(2)
749- opacity: action.enabled ? 1.0 : 0.5
750 }
751
752 Label {
753@@ -107,7 +108,6 @@
754 elide: Text.ElideRight
755 text: action.text
756 color: overflow.foregroundColor
757- opacity: action.enabled ? 1.0 : 0.5
758 }
759
760 // The value of showDivider is automatically set by ActionSelectionPopover.
761
762=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml'
763--- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml 2016-01-06 11:24:54 +0000
764+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml 2016-01-27 16:42:56 +0000
765@@ -66,28 +66,34 @@
766 \deprecated
767 The background color of the tapped item in the panel.
768 */
769- property color panelHighlightColor: theme.palette.selected.background
770+ property color panelHighlightColor: theme.palette.highlighted.background
771
772 /*!
773 \deprecated
774 The foreground color (icon and text) of actions in the panel.
775 */
776- property color panelForegroundColor: theme.palette.selected.backgroundText
777+ property color panelForegroundColor: styledItem.enabled
778+ ? theme.palette.normal.backgroundText
779+ : theme.palette.disabled.backgroundText
780
781 /*!
782 The text color of unselected sections and the section divider.
783 */
784- property color sectionColor: theme.palette.selected.backgroundText
785+ property color sectionColor: styledItem.enabled
786+ ? theme.palette.normal.backgroundText
787+ : theme.palette.disabled.backgroundText
788
789 /*!
790 The text color of the selected section.
791 */
792- property color selectedSectionColor: UbuntuColors.orange
793+ property color selectedSectionColor: styledItem.enabled
794+ ? theme.palette.selected.backgroundText
795+ : theme.palette.selectedDisabled.backgroundText
796
797 /*!
798 The background color of the pressed section.
799 */
800- property color sectionHighlightColor: theme.palette.selected.background
801+ property color sectionHighlightColor: theme.palette.highlighted.background
802
803 implicitHeight: headerStyle.contentHeight + divider.height + sectionsItem.height
804
805
806=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/Palette.qml'
807--- src/Ubuntu/Components/Themes/Ambiance/1.3/Palette.qml 2016-01-13 16:07:58 +0000
808+++ src/Ubuntu/Components/Themes/Ambiance/1.3/Palette.qml 2016-01-27 16:42:56 +0000
809@@ -1,5 +1,5 @@
810 /*
811- * Copyright 2013 Canonical Ltd.
812+ * Copyright 2016 Canonical Ltd.
813 *
814 * This program is free software; you can redistribute it and/or modify
815 * it under the terms of the GNU Lesser General Public License as published by
816@@ -20,32 +20,40 @@
817
818 Palette {
819 normal: AmbianceNormal {}
820- inactive: AmbianceNormal {
821+ disabled: AmbianceNormal {
822 field: UbuntuColors.porcelain;
823- // inactive is 30% transparent normal
824+ // inactive is 30% opaque normal
825 Component.onCompleted: {
826 for (var p in normal) {
827 // skip objectName and all change signals
828 if (p == "objectName" || p == "field" || p.indexOf("Changed") > 0) continue;
829- inactive[p] = Qt.rgba(normal[p].r, normal[p].g, normal[p].b, 0.3);
830+ disabled[p] = Qt.rgba(normal[p].r, normal[p].g, normal[p].b, 0.3);
831 }
832 }
833 }
834
835 // selected differs from normal in background, base, foreground
836- selected: AmbianceNormal {
837- background: UbuntuColors.porcelain
838- backgroundText: UbuntuColors.blue
839- base: UbuntuColors.ash
840- baseText: UbuntuColors.blue
841- foreground: UbuntuColors.silk
842- foregroundText: UbuntuColors.blue
843- }
844+ selected: AmbianceSelected {}
845
846 // selected differs from normal in background, base, foreground
847- selectedInactive: AmbianceNormal {
848+ selectedDisabled: AmbianceSelected {
849 background: UbuntuColors.porcelain
850 base: UbuntuColors.porcelain
851 foreground: UbuntuColors.porcelain
852+ // inactive is 30% opaque normal
853+ Component.onCompleted: {
854+ for (var p in selected) {
855+ // skip objectName and all change signals
856+ if (p == "objectName" || p.indexOf("Changed") > 0
857+ || p == "background" || p == "base" || p == "foreground" ) continue;
858+ selectedDisabled[p] = Qt.rgba(selected[p].r, selected[p].g, selected[p].b, 0.3);
859+ }
860+ }
861+ }
862+
863+ highlighted: AmbianceNormal {
864+ background: UbuntuColors.silk
865+ base: UbuntuColors.jet
866+ foreground: UbuntuColors.silk
867 }
868 }
869
870=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PickerStyle.qml'
871--- src/Ubuntu/Components/Themes/Ambiance/1.3/PickerStyle.qml 2015-12-04 12:02:19 +0000
872+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PickerStyle.qml 2016-01-27 16:42:56 +0000
873@@ -26,7 +26,7 @@
874 */
875 property color backgroundColor: styledItem.enabled
876 ? theme.palette.normal.foreground
877- : theme.palette.inactive.foreground
878+ : theme.palette.disabled.foreground
879 /*!
880 Background color for highlight.
881 */
882@@ -34,7 +34,7 @@
883 /*!
884 Highlight color.
885 */
886- property color highlightColor: UbuntuColors.orange
887+ property color highlightColor: theme.palette.highlighted.baseText
888 /*!
889 Scale of the highlight item
890 */
891
892=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PopoverForegroundStyle.qml'
893--- src/Ubuntu/Components/Themes/Ambiance/1.3/PopoverForegroundStyle.qml 2015-12-09 12:34:18 +0000
894+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PopoverForegroundStyle.qml 2016-01-27 16:42:56 +0000
895@@ -1,5 +1,5 @@
896 /*
897- * Copyright 2013 Canonical Ltd.
898+ * Copyright 2016 Canonical Ltd.
899 *
900 * This program is free software; you can redistribute it and/or modify
901 * it under the terms of the GNU Lesser General Public License as published by
902@@ -18,6 +18,9 @@
903
904 BubbleShape {
905 property alias contentItem: content
906+ color: styledItem.enabled
907+ ? theme.palette.normal.overlay
908+ : theme.palette.disabled.overlay
909
910 target: styledItem.target
911 direction: styledItem.direction
912
913=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ProgressBarStyle.qml'
914--- src/Ubuntu/Components/Themes/Ambiance/1.3/ProgressBarStyle.qml 2016-01-13 15:57:53 +0000
915+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ProgressBarStyle.qml 2016-01-27 16:42:56 +0000
916@@ -20,10 +20,18 @@
917 Item {
918 id: progressBarStyle
919
920- property color foregroundColor: theme.palette.normal.activity
921- property color foregroundTextColor: theme.palette.normal.activityText
922- property color backgroundColor: theme.palette.normal.base
923- property color backgroundTextColor: theme.palette.normal.baseText
924+ property color foregroundColor: styledItem.enabled
925+ ? theme.palette.normal.activity
926+ : theme.palette.disabled.activity
927+ property color foregroundTextColor: styledItem.enabled
928+ ? theme.palette.normal.activityText
929+ : theme.palette.disabled.activityText
930+ property color backgroundColor: styledItem.enabled
931+ ? theme.palette.normal.base
932+ : theme.palette.disabled.base
933+ property color backgroundTextColor: styledItem.enabled
934+ ? theme.palette.normal.baseText
935+ : theme.palette.disabled.baseText
936
937 property var progressBar: styledItem
938
939
940=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml'
941--- src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml 2015-12-16 15:01:29 +0000
942+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml 2016-01-27 16:42:56 +0000
943@@ -82,10 +82,10 @@
944 property real troughThicknessSteppersStyle : units.dp(14)
945 property real troughThicknessThumbStyle : units.dp(14)
946 property real troughThicknessIndicatorStyle : units.dp(9)
947- property color troughColorThumbStyle: "#CDCDCD"
948- property color troughColorSteppersStyle: "#f7f7f7"
949+ property color troughColorThumbStyle: theme.palette.normal.foreground
950+ property color troughColorSteppersStyle: theme.palette.normal.foreground
951
952- property color sliderColor: "#3b3b3b"
953+ property color sliderColor: theme.palette.normal.foregroundText
954 property real sliderRadius: units.dp(3)
955 property real thumbThickness: units.gu(1)
956 property real indicatorThickness : units.dp(3)
957@@ -764,11 +764,13 @@
958 when: !isVertical
959 value: visible ? troughThicknessSteppersStyle : 0
960 }
961- Image {
962+
963+ Icon {
964 anchors.centerIn: parent
965 rotation: isVertical ? 180 : 90
966 source: Qt.resolvedUrl("../artwork/scrollbar_arrow.png")
967- cache: true
968+ color: sliderColor
969+ keyColor: "#5d5d5d"
970 }
971 }
972 Rectangle {
973@@ -795,12 +797,12 @@
974 when: !isVertical
975 value: visible ? troughThicknessSteppersStyle : 0
976 }
977- Image {
978+ Icon {
979 anchors.centerIn: parent
980- fillMode: Image.PreserveAspectFit
981 rotation: isVertical ? 0 : -90
982 source: Qt.resolvedUrl("../artwork/scrollbar_arrow.png")
983- cache: true
984+ color: sliderColor
985+ keyColor: "#5d5d5d"
986 }
987 }
988 }
989
990=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml'
991--- src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml 2016-01-14 15:10:44 +0000
992+++ src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml 2016-01-27 16:42:56 +0000
993@@ -1,5 +1,5 @@
994 /*
995- * Copyright 2015 Canonical Ltd.
996+ * Copyright 2016 Canonical Ltd.
997 *
998 * This program is free software; you can redistribute it and/or modify
999 * it under the terms of the GNU Lesser General Public License as published by
1000@@ -23,22 +23,25 @@
1001 implicitHeight: units.gu(4)
1002
1003 enabled: styledItem.enabled
1004- opacity: enabled ? 1.0 : 0.5
1005
1006 /*!
1007 The foreground color of unselected sections.
1008 */
1009- property color sectionColor: theme.palette.normal.backgroundText
1010+ property color sectionColor: enabled
1011+ ? theme.palette.normal.backgroundTertiaryText
1012+ : theme.palette.disabled.backgroundTertiaryText
1013
1014 /*!
1015 The foreground color of the selected section.
1016 */
1017- property color selectedSectionColor: UbuntuColors.orange
1018+ property color selectedSectionColor: enabled
1019+ ? theme.palette.selected.backgroundTertiaryText
1020+ : theme.palette.selectedDisabled.backgroundTertiaryText
1021
1022 /*!
1023 The background color for the pressed section button.
1024 */
1025- property color pressedBackgroundColor: theme.palette.selected.background
1026+ property color pressedBackgroundColor: theme.palette.highlighted.background
1027
1028 /*!
1029 The font size for the text in the buttons.
1030
1031=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/SliderStyle.qml'
1032--- src/Ubuntu/Components/Themes/Ambiance/1.3/SliderStyle.qml 2015-12-04 09:52:05 +0000
1033+++ src/Ubuntu/Components/Themes/Ambiance/1.3/SliderStyle.qml 2016-01-27 16:42:56 +0000
1034@@ -1,5 +1,5 @@
1035 /*
1036- * Copyright 2015 Canonical Ltd.
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@@ -116,8 +116,8 @@
1042 id: label
1043 anchors.centerIn: parent
1044 text: styledItem.formatValue(SliderUtils.liveValue(styledItem))
1045- textSize: Label.Large
1046- color: theme.palette.normal.raisedText
1047+ textSize: Label.Medium
1048+ color: theme.palette.normal.overlayText
1049 }
1050 }
1051 }
1052
1053=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/SwitchStyle.qml'
1054--- src/Ubuntu/Components/Themes/Ambiance/1.3/SwitchStyle.qml 2016-01-13 14:25:22 +0000
1055+++ src/Ubuntu/Components/Themes/Ambiance/1.3/SwitchStyle.qml 2016-01-27 16:42:56 +0000
1056@@ -33,16 +33,16 @@
1057 /*!
1058 The background color of the switch.
1059 */
1060- property color backgroundColor: styledItem.enabled ? theme.palette.normal.base : theme.palette.inactive.base
1061+ property color backgroundColor: styledItem.enabled ? theme.palette.normal.base : theme.palette.disabled.base
1062
1063 /*!
1064 The background color of the checked switch.
1065 */
1066- property color checkedBackgroundColor: styledItem.enabled ? theme.palette.normal.positive : theme.palette.inactive.base
1067+ property color checkedBackgroundColor: styledItem.enabled ? theme.palette.normal.positive : theme.palette.disabled.base
1068 /*!
1069 The background color of the thumb.
1070 */
1071- property color thumbColor: styledItem.enabled ? theme.palette.normal.raised : theme.palette.inactive.raised
1072+ property color thumbColor: styledItem.enabled ? theme.palette.normal.raised : theme.palette.disabled.raised
1073
1074 FocusShape {
1075 }
1076
1077=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml'
1078--- src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml 2015-12-04 10:30:34 +0000
1079+++ src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml 2016-01-27 16:42:56 +0000
1080@@ -29,9 +29,9 @@
1081 ? ((styledItem.activeFocus || styledItem.highlighted)
1082 ? theme.palette.selected.fieldText
1083 : theme.palette.normal.fieldText)
1084- : theme.palette.inactive.fieldText
1085- property color selectedTextColor: styledItem.enabled ? theme.palette.selected.selectionText : theme.palette.inactive.selectionText
1086- property color selectionColor: styledItem.enabled ? theme.palette.selected.selection : theme.palette.inactive.selection
1087+ : theme.palette.disabled.fieldText
1088+ property color selectedTextColor: styledItem.enabled ? theme.palette.selected.selectionText : theme.palette.disabled.selectionText
1089+ property color selectionColor: styledItem.enabled ? theme.palette.selected.selection : theme.palette.disabled.selection
1090 /*!
1091 Background fill color
1092 */
1093@@ -39,8 +39,8 @@
1094 ? ((styledItem.activeFocus || styledItem.highlighted)
1095 ? theme.palette.selected.field
1096 : theme.palette.normal.field)
1097- : theme.palette.inactive.field
1098- property color errorColor: styledItem.enabled ? theme.palette.normal.negative : theme.palette.inactive.negative
1099+ : theme.palette.disabled.field
1100+ property color errorColor: styledItem.enabled ? theme.palette.normal.negative : theme.palette.disabled.negative
1101
1102 /*!
1103 Spacing between the frame and the text editor area
1104
1105=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/TextCursorStyle.qml'
1106--- src/Ubuntu/Components/Themes/Ambiance/1.3/TextCursorStyle.qml 2015-12-05 05:59:07 +0000
1107+++ src/Ubuntu/Components/Themes/Ambiance/1.3/TextCursorStyle.qml 2016-01-27 16:42:56 +0000
1108@@ -1,5 +1,5 @@
1109 /*
1110- * Copyright 2012 Canonical Ltd.
1111+ * Copyright 2016 Canonical Ltd.
1112 *
1113 * This program is free software; you can redistribute it and/or modify
1114 * it under the terms of the GNU Lesser General Public License as published by
1115@@ -55,8 +55,8 @@
1116 Rectangle {
1117 objectName: "text_cursor_style_" + styledItem.positionProperty
1118 width: cursorWidth
1119- // FIXME: Extend the palette and use palette values here
1120- color: UbuntuColors.blue
1121+ // FIXME: check with design whether should it be activity or something else
1122+ color: theme.palette.normal.activity
1123 visible: blinkTimer.timerShowCursor || !blinkTimer.running
1124 Timer {
1125 id: blinkTimer
1126
1127=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ToolbarButtonStyle.qml'
1128--- src/Ubuntu/Components/Themes/Ambiance/1.3/ToolbarButtonStyle.qml 2015-12-04 10:30:34 +0000
1129+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ToolbarButtonStyle.qml 2016-01-27 16:42:56 +0000
1130@@ -1,5 +1,5 @@
1131 /*
1132- * Copyright 2012 Canonical Ltd.
1133+ * Copyright 2016 Canonical Ltd.
1134 *
1135 * This program is free software; you can redistribute it and/or modify
1136 * it under the terms of the GNU Lesser General Public License as published by
1137@@ -29,20 +29,19 @@
1138 Item {
1139 anchors.centerIn: parent
1140 height: icon.height + label.height + label.anchors.topMargin
1141- opacity: styledItem.enabled ? 1.0 : 0.3
1142
1143 // FIXME: is there a reason we are still using styledItem.iconSource instead of iconName
1144 // so we coudl use the Icon?
1145- Image {
1146+ Icon {
1147 id: icon
1148 anchors {
1149 top: parent.top
1150 horizontalCenter: parent.horizontalCenter
1151 }
1152- sourceSize.width: iconWidth
1153- sourceSize.height: iconWidth
1154- source: styledItem.iconSource
1155- smooth: true
1156+ width: iconWidth
1157+ height: iconWidth
1158+ name: styledItem.iconName
1159+ color: label.color
1160 }
1161
1162 Label {
1163@@ -56,8 +55,8 @@
1164 text: styledItem.text
1165 textSize: Label.XSmall
1166 color: styledItem.enabled
1167- ? theme.palette.normal.raisedText
1168- : theme.palette.inactive.raisedText
1169+ ? theme.palette.normal.overlayText
1170+ : theme.palette.disabled.overlayText
1171 }
1172 }
1173
1174
1175=== modified file 'src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro'
1176--- src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro 2016-01-13 14:25:22 +0000
1177+++ src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro 2016-01-27 16:42:56 +0000
1178@@ -74,6 +74,7 @@
1179 1.2/ToolbarButtonStyle.qml \
1180 1.2/DeprecatedToolbarStyle.qml \
1181 1.3/AmbianceNormal.qml \
1182+ 1.3/AmbianceSelected.qml \
1183 1.3/ActionBarStyle.qml \
1184 1.3/ActivityIndicatorStyle.qml \
1185 1.3/BubbleShape.qml \
1186
1187=== modified file 'src/Ubuntu/Components/Themes/SuruDark/1.3/Palette.qml'
1188--- src/Ubuntu/Components/Themes/SuruDark/1.3/Palette.qml 2016-01-13 16:07:58 +0000
1189+++ src/Ubuntu/Components/Themes/SuruDark/1.3/Palette.qml 2016-01-27 16:42:56 +0000
1190@@ -1,5 +1,5 @@
1191 /*
1192- * Copyright 2015 Canonical Ltd.
1193+ * Copyright 2016 Canonical Ltd.
1194 *
1195 * This program is free software; you can redistribute it and/or modify
1196 * it under the terms of the GNU Lesser General Public License as published by
1197@@ -21,33 +21,42 @@
1198
1199 Palette {
1200 normal: SuruDarkNormal {}
1201- inactive: SuruDarkNormal {
1202+ disabled: SuruDarkNormal {
1203 field: UbuntuColors.inkstone
1204 // inactive is 30% transparent normal
1205 Component.onCompleted: {
1206 for (var p in normal) {
1207 // skip objectName and all change signals
1208- if (p == "objectName" || p == "field" || p.indexOf("Changed") > 0) continue;
1209- inactive[p] = Qt.rgba(normal[p].r, normal[p].g, normal[p].b, 0.3);
1210+ if (p == "objectName"|| p.indexOf("Changed") > 0
1211+ || p == "field" || p == "foreground" ) continue;
1212+ disabled[p] = Qt.rgba(normal[p].r, normal[p].g, normal[p].b, 0.3);
1213 }
1214 }
1215 }
1216
1217 // selected differs from normal in background, base, foreground
1218- selected: SuruDarkNormal {
1219- background: UbuntuColors.inkstone
1220- backgroundText: UbuntuColors.blue
1221- base: UbuntuColors.ash
1222- baseText:UbuntuColors.blue
1223- foreground: UbuntuColors.slate
1224- foregroundText: UbuntuColors.blue
1225- }
1226+ selected: SuruDarkSelected {}
1227
1228 // selected differs from normal in background, base, foreground
1229- selectedInactive: SuruDarkNormal {
1230+ selectedDisabled: SuruDarkSelected {
1231 background: UbuntuColors.inkstone
1232 base: UbuntuColors.inkstone
1233 foreground: UbuntuColors.inkstone
1234+ // inactive is 30% transparent normal
1235+ Component.onCompleted: {
1236+ for (var p in selected) {
1237+ // skip objectName and all change signals
1238+ if (p == "objectName"|| p.indexOf("Changed") > 0
1239+ || p == "field" || p == "foreground" ) continue;
1240+ selectedDisabled[p] = Qt.rgba(selected[p].r, selected[p].g, selected[p].b, 0.3);
1241+ }
1242+ }
1243+ }
1244+
1245+ highlighted: SuruDarkNormal {
1246+ background: UbuntuColors.slate
1247+ base: UbuntuColors.graphite
1248+ foreground: UbuntuColors.slate
1249 }
1250 }
1251 //![0]
1252
1253=== modified file 'src/Ubuntu/Components/Themes/SuruDark/1.3/SuruDarkNormal.qml'
1254--- src/Ubuntu/Components/Themes/SuruDark/1.3/SuruDarkNormal.qml 2016-01-13 16:07:58 +0000
1255+++ src/Ubuntu/Components/Themes/SuruDark/1.3/SuruDarkNormal.qml 2016-01-27 16:42:56 +0000
1256@@ -1,5 +1,5 @@
1257 /*
1258- * Copyright 2015 Canonical Ltd.
1259+ * Copyright 2016 Canonical Ltd.
1260 *
1261 * This program is free software; you can redistribute it and/or modify
1262 * it under the terms of the GNU Lesser General Public License as published by
1263@@ -24,7 +24,7 @@
1264 backgroundSecondaryText: UbuntuColors.silk
1265 backgroundTertiaryText: UbuntuColors.ash
1266 base: UbuntuColors.graphite
1267- baseText: UbuntuColors.silk
1268+ baseText: UbuntuColors.ash
1269 foreground: UbuntuColors.inkstone
1270 foregroundText: "#FFFFFF"
1271 raised: "#FFFFFF"
1272@@ -35,7 +35,9 @@
1273 overlaySecondaryText: UbuntuColors.slate
1274 field: UbuntuColors.jet
1275 fieldText: "#FFFFFF"
1276- selection: Qt.rgba(UbuntuColors.orange.r, UbuntuColors.orange.g, UbuntuColors.orange.b, 0.4)
1277+ focus: UbuntuColors.orange
1278+ focusText: "#FFFFFF"
1279+ selection: Qt.rgba(UbuntuColors.blue.r, UbuntuColors.blue.g, UbuntuColors.blue.b, 0.4)
1280 selectionText: "#FFFFFF"
1281 positive: UbuntuColors.green
1282 positiveText: "#FFFFFF"
1283
1284=== added file 'src/Ubuntu/Components/Themes/SuruDark/1.3/SuruDarkSelected.qml'
1285--- src/Ubuntu/Components/Themes/SuruDark/1.3/SuruDarkSelected.qml 1970-01-01 00:00:00 +0000
1286+++ src/Ubuntu/Components/Themes/SuruDark/1.3/SuruDarkSelected.qml 2016-01-27 16:42:56 +0000
1287@@ -0,0 +1,29 @@
1288+/*
1289+ * Copyright 2016 Canonical Ltd.
1290+ *
1291+ * This program is free software; you can redistribute it and/or modify
1292+ * it under the terms of the GNU Lesser General Public License as published by
1293+ * the Free Software Foundation; version 3.
1294+ *
1295+ * This program is distributed in the hope that it will be useful,
1296+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1297+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1298+ * GNU Lesser General Public License for more details.
1299+ *
1300+ * You should have received a copy of the GNU Lesser General Public License
1301+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1302+ */
1303+
1304+import QtQuick 2.4
1305+import Ubuntu.Components 1.3
1306+import Ubuntu.Components.Themes 1.3
1307+
1308+SuruDarkNormal {
1309+ background: UbuntuColors.inkstone
1310+ backgroundText: UbuntuColors.blue
1311+ backgroundTertiaryText: UbuntuColors.blue
1312+ base: UbuntuColors.ash
1313+ baseText:UbuntuColors.blue
1314+ foreground: UbuntuColors.slate
1315+}
1316+
1317
1318=== modified file 'src/Ubuntu/Components/Themes/SuruDark/SuruDark.pro'
1319--- src/Ubuntu/Components/Themes/SuruDark/SuruDark.pro 2015-12-04 09:23:50 +0000
1320+++ src/Ubuntu/Components/Themes/SuruDark/SuruDark.pro 2016-01-27 16:42:56 +0000
1321@@ -9,6 +9,7 @@
1322 1.2/TabBarStyle.qml \
1323 1.3/OptionSelectorStyle.qml \
1324 1.3/SuruDarkNormal.qml \
1325+ 1.3/SuruDarkSelected.qml \
1326 1.3/Palette.qml \
1327 1.3/TabBarStyle.qml \
1328 $$ARTWORK_FILES \
1329
1330=== modified file 'src/Ubuntu/Components/plugin/privates/threelabelsslot_p.cpp'
1331--- src/Ubuntu/Components/plugin/privates/threelabelsslot_p.cpp 2016-01-07 17:09:14 +0000
1332+++ src/Ubuntu/Components/plugin/privates/threelabelsslot_p.cpp 2016-01-27 16:42:56 +0000
1333@@ -18,6 +18,7 @@
1334 #include "uclabel.h"
1335 #include "ucunits.h"
1336 #include "ucfontutils.h"
1337+#include "uctheme.h"
1338
1339 UCThreeLabelsSlotPrivate::UCThreeLabelsSlotPrivate()
1340 : QQuickItemPrivate()
1341@@ -178,11 +179,19 @@
1342 return d->m_title;
1343 }
1344
1345+QColor UCThreeLabelsSlot::getSubtitleColor(QQuickItem *item, UCTheme *theme)
1346+{
1347+ // FIXME: replace the code below with automatic color
1348+ // change detection based on teh item's state
1349+ const char *valueSet = item->isEnabled() ? "normal" : "disabled";
1350+ return theme ? theme->getPaletteColor(valueSet, "backgroundSecondaryText") : QColor();
1351+}
1352+
1353 UCLabel *UCThreeLabelsSlot::subtitle()
1354 {
1355 Q_D(UCThreeLabelsSlot);
1356 if (d->m_subtitle == Q_NULLPTR) {
1357- d->m_subtitle = new UCLabel(this);
1358+ d->m_subtitle = new UCLabel(getSubtitleColor, this);
1359 QQmlEngine::setContextForObject(d->m_subtitle, qmlContext(this));
1360 d->m_subtitle->init();
1361
1362@@ -200,11 +209,19 @@
1363 return d->m_subtitle;
1364 }
1365
1366+QColor UCThreeLabelsSlot::getSummaryColor(QQuickItem *item, UCTheme *theme)
1367+{
1368+ // FIXME: replace the code below with automatic color
1369+ // change detection based on teh item's state
1370+ const char *valueSet = item->isEnabled() ? "normal" : "disabled";
1371+ return theme ? theme->getPaletteColor(valueSet, "backgroundTertiaryText") : QColor();
1372+}
1373+
1374 UCLabel *UCThreeLabelsSlot::summary()
1375 {
1376 Q_D(UCThreeLabelsSlot);
1377 if (d->m_summary == Q_NULLPTR) {
1378- d->m_summary = new UCLabel(this);
1379+ d->m_summary = new UCLabel(getSummaryColor, this);
1380 QQmlEngine::setContextForObject(d->m_summary, qmlContext(this));
1381 d->m_summary->init();
1382
1383
1384=== modified file 'src/Ubuntu/Components/plugin/privates/threelabelsslot_p.h'
1385--- src/Ubuntu/Components/plugin/privates/threelabelsslot_p.h 2016-01-07 17:09:14 +0000
1386+++ src/Ubuntu/Components/plugin/privates/threelabelsslot_p.h 2016-01-27 16:42:56 +0000
1387@@ -24,6 +24,7 @@
1388 //summary, when subtitle is empty)
1389 #define TITLE_SPACING_DP 2
1390
1391+class UCTheme;
1392 class UCLabel;
1393 class UCThreeLabelsSlotPrivate;
1394 class UCThreeLabelsSlot : public QQuickItem
1395@@ -46,6 +47,9 @@
1396 private:
1397 Q_PRIVATE_SLOT(d_func(), void _q_onGuValueChanged())
1398 Q_PRIVATE_SLOT(d_func(), void _q_updateLabelsAnchorsAndBBoxHeight())
1399+
1400+ static QColor getSubtitleColor(QQuickItem *item, UCTheme *theme);
1401+ static QColor getSummaryColor(QQuickItem *item, UCTheme *theme);
1402 };
1403
1404 class UCThreeLabelsSlotPrivate : public QQuickItemPrivate
1405
1406=== modified file 'src/Ubuntu/Components/plugin/ucbottomedge.cpp'
1407--- src/Ubuntu/Components/plugin/ucbottomedge.cpp 2016-01-13 16:07:58 +0000
1408+++ src/Ubuntu/Components/plugin/ucbottomedge.cpp 2016-01-27 16:42:56 +0000
1409@@ -62,6 +62,10 @@
1410 Q_Q(UCBottomEdge);
1411 // initialize hint
1412 QQml_setParent_noEvent(hint, q);
1413+ // keep BottomEdge.enabled in sync with the hint
1414+ QObject::connect(q, &UCBottomEdge::enabledChanged, [=] {
1415+ hint->setEnabled2(q->isEnabled());
1416+ });
1417
1418 // create default regions
1419 createDefaultRegions();
1420
1421=== modified file 'src/Ubuntu/Components/plugin/uclabel.cpp'
1422--- src/Ubuntu/Components/plugin/uclabel.cpp 2016-01-13 14:25:22 +0000
1423+++ src/Ubuntu/Components/plugin/uclabel.cpp 2016-01-27 16:42:56 +0000
1424@@ -79,9 +79,27 @@
1425 UCLabel::UCLabel(QQuickItem* parent)
1426 : QQuickText(parent)
1427 , UCThemingExtension(this)
1428- , m_textSize(Medium)
1429- , m_flags(0)
1430-{
1431+ , m_defaultColor(getDefaultColor)
1432+ , m_textSize(Medium)
1433+ , m_flags(0)
1434+{
1435+}
1436+
1437+UCLabel::UCLabel(std::function<QColor (QQuickItem*, UCTheme*)> defaultColor, QQuickItem *parent)
1438+ : QQuickText(parent)
1439+ , UCThemingExtension(this)
1440+ , m_defaultColor(defaultColor)
1441+ , m_textSize(Medium)
1442+ , m_flags(0)
1443+{
1444+}
1445+
1446+QColor UCLabel::getDefaultColor(QQuickItem *item, UCTheme *theme)
1447+{
1448+ // FIXME: replace the code below with automatic color
1449+ // change detection based on teh item's state
1450+ const char *valueSet = item->isEnabled() ? "normal" : "disabled";
1451+ return theme ? theme->getPaletteColor(valueSet, "backgroundText") : QColor();
1452 }
1453
1454 void UCLabel::classBegin()
1455@@ -101,6 +119,7 @@
1456
1457 connect(this, &UCLabel::fontChanged, this, &UCLabel::_q_updateFontFlag, Qt::DirectConnection);
1458 connect(this, &UCLabel::colorChanged, this, &UCLabel::_q_customColor, Qt::DirectConnection);
1459+ connect(this, &UCLabel::enabledChanged, this, &UCLabel::postThemeChanged, Qt::DirectConnection);
1460 }
1461
1462 void UCLabel::postThemeChanged()
1463@@ -110,7 +129,7 @@
1464 }
1465 UCTheme *theme = getTheme();
1466 if (theme) {
1467- setColor(theme->getPaletteColor("normal", "baseText"));
1468+ setColor(m_defaultColor(this, theme));
1469 m_flags &= ~ColorSet;
1470 }
1471 }
1472
1473=== modified file 'src/Ubuntu/Components/plugin/uclabel.h'
1474--- src/Ubuntu/Components/plugin/uclabel.h 2015-10-20 10:19:10 +0000
1475+++ src/Ubuntu/Components/plugin/uclabel.h 2016-01-27 16:42:56 +0000
1476@@ -19,6 +19,8 @@
1477
1478 #include <QtQuick/private/qquicktext_p.h>
1479 #include "ucthemingextension.h"
1480+// C++ std lib for std::function declaration
1481+#include <functional>
1482
1483 class UCLabel : public QQuickText, public UCThemingExtension
1484 {
1485@@ -32,6 +34,8 @@
1486
1487 public:
1488 UCLabel(QQuickItem* parent=0);
1489+ // custom constructor to create the label with a different default color provider
1490+ UCLabel(std::function<QColor (QQuickItem*, UCTheme*)> defaultColor, QQuickItem *parent = 0);
1491 //QQuickTextPrivate is not exported as of 5.4.1 so we need the init here
1492 void init();
1493
1494@@ -74,6 +78,7 @@
1495
1496 private:
1497 void updatePixelSize();
1498+ static QColor getDefaultColor(QQuickItem *item, UCTheme *theme);
1499 Q_SLOT void _q_updateFontFlag(const QFont &font);
1500 Q_SLOT void _q_customColor();
1501
1502@@ -84,6 +89,7 @@
1503 };
1504
1505 QFont m_defaultFont;
1506+ std::function<QColor (QQuickItem *, UCTheme*)> m_defaultColor;
1507 TextSize m_textSize;
1508 quint8 m_flags;
1509
1510
1511=== modified file 'src/Ubuntu/Components/plugin/uclistitem.cpp'
1512--- src/Ubuntu/Components/plugin/uclistitem.cpp 2016-01-13 15:40:16 +0000
1513+++ src/Ubuntu/Components/plugin/uclistitem.cpp 2016-01-27 16:42:56 +0000
1514@@ -1654,7 +1654,7 @@
1515 d->customColor = false;
1516 UCTheme *theme = getTheme();
1517 if (theme) {
1518- d->highlightColor = theme->getPaletteColor("selected", "foreground");
1519+ d->highlightColor = theme->getPaletteColor("highlighted", "background");
1520 }
1521 update();
1522 Q_EMIT highlightColorChanged();
1523
1524=== modified file 'tests/unit_x11/tst_bottomedge/tst_bottomedge.cpp'
1525--- tests/unit_x11/tst_bottomedge/tst_bottomedge.cpp 2015-12-17 15:23:26 +0000
1526+++ tests/unit_x11/tst_bottomedge/tst_bottomedge.cpp 2016-01-27 16:42:56 +0000
1527@@ -863,6 +863,14 @@
1528 QPoint delta(0, -bottomEdge->height());
1529 UCTestExtras::touchDrag(0, bottomEdge, from, delta, 20);
1530 }
1531+
1532+ void test_bottomedge_hint_enabled() {
1533+ QScopedPointer<BottomEdgeTestCase> view(new BottomEdgeTestCase("Defaults.qml"));
1534+ UCBottomEdge *bottomEdge = view->testItem();
1535+ QCOMPARE(bottomEdge->isEnabled(), bottomEdge->hint()->isEnabled());
1536+ bottomEdge->setEnabled(!bottomEdge->isEnabled());
1537+ QCOMPARE(bottomEdge->isEnabled(), bottomEdge->hint()->isEnabled());
1538+ }
1539 };
1540
1541 QTEST_MAIN(tst_BottomEdge)
1542
1543=== modified file 'tests/unit_x11/tst_components/AppTheme/Palette.qml'
1544--- tests/unit_x11/tst_components/AppTheme/Palette.qml 2016-01-14 06:25:42 +0000
1545+++ tests/unit_x11/tst_components/AppTheme/Palette.qml 2016-01-27 16:42:56 +0000
1546@@ -20,5 +20,5 @@
1547
1548 Suru.Palette {
1549 normal.background: "#A21E1C"
1550- normal.baseText: "lightblue"
1551+ normal.backgroundText: "lightblue"
1552 }
1553
1554=== modified file 'tests/unit_x11/tst_components/tst_slotslayout.qml'
1555--- tests/unit_x11/tst_components/tst_slotslayout.qml 2016-01-07 17:09:14 +0000
1556+++ tests/unit_x11/tst_components/tst_slotslayout.qml 2016-01-27 16:42:56 +0000
1557@@ -447,6 +447,13 @@
1558 }
1559 }
1560
1561+ function initTestCase() {
1562+ // check the coloring of the mainslot labels
1563+ compare(layoutEmpty.title.color, theme.palette.normal.backgroundText, "wrong title color");
1564+ compare(layoutEmpty.subtitle.color, theme.palette.normal.backgroundSecondaryText, "wrong subtitle color");
1565+ compare(layoutEmpty.summary.color, theme.palette.normal.backgroundTertiaryText, "wrong summary color");
1566+ }
1567+
1568 function test_contentPadding_data() {
1569 return standardTestsData()
1570 }

Subscribers

People subscribed via source and target branches