Merge lp:~fboucault/ubuntu-ui-toolkit/ubuntu_colors into lp:ubuntu-ui-toolkit
- ubuntu_colors
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Tim Peeters | ||||
Approved revision: | 595 | ||||
Merged at revision: | 573 | ||||
Proposed branch: | lp:~fboucault/ubuntu-ui-toolkit/ubuntu_colors | ||||
Merge into: | lp:ubuntu-ui-toolkit | ||||
Prerequisite: | lp:~fboucault/ubuntu-ui-toolkit/simple_theming | ||||
Diff against target: |
458 lines (+147/-23) 23 files modified
debian/qtdeclarative5-ubuntu-ui-toolkit-plugin.install (+1/-0) examples/ubuntu-ui-toolkit-gallery/AnimationCircle.qml (+1/-1) examples/ubuntu-ui-toolkit-gallery/Dialog.qml (+1/-1) examples/ubuntu-ui-toolkit-gallery/Icons.qml (+2/-2) examples/ubuntu-ui-toolkit-gallery/UbuntuShape.qml (+3/-3) modules/Ubuntu/Components/Colors/Colors.pro (+9/-0) modules/Ubuntu/Components/Colors/FIXME (+3/-0) modules/Ubuntu/Components/Colors/UbuntuColors.qml (+63/-0) modules/Ubuntu/Components/Components.pro (+1/-1) modules/Ubuntu/Components/Icon.qml (+1/-1) modules/Ubuntu/Components/Label.qml (+2/-2) modules/Ubuntu/Components/ListItems/LabelVisual.qml (+1/-1) modules/Ubuntu/Components/MainView.qml (+3/-3) modules/Ubuntu/Components/PageStack.qml (+1/-1) modules/Ubuntu/Components/Popups/ComposerSheet.qml (+1/-1) modules/Ubuntu/Components/Popups/DefaultSheet.qml (+1/-1) modules/Ubuntu/Components/Popups/Dialog.qml (+2/-2) modules/Ubuntu/Components/Themes/Ambiance/TextAreaStyle.qml (+1/-1) modules/Ubuntu/Components/UbuntuNumberAnimation.qml (+1/-1) modules/Ubuntu/Components/plugin/plugin.cpp (+30/-0) modules/Ubuntu/Components/plugin/plugin.h (+2/-0) modules/Ubuntu/Components/plugin/quickutils.cpp (+15/-1) modules/Ubuntu/Components/plugin/quickutils.h (+2/-0) |
||||
To merge this branch: | bzr merge lp:~fboucault/ubuntu-ui-toolkit/ubuntu_colors | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Peeters | Approve | ||
PS Jenkins bot | continuous-integration | Approve | |
Zsombor Egri | Needs Fixing | ||
Review via email: mp+172340@code.launchpad.net |
Commit message
New UbuntuColors singleton defining the standard Ubuntu color palette.
Description of the change
Tim Peeters (tpeeters) wrote : | # |
Tim Peeters (tpeeters) wrote : | # |
UbuntuColors is in the module Ubuntu.Components, which already has Ubuntu in the name so instead of Ubuntu.
Tim Peeters (tpeeters) wrote : | # |
367 +void UbuntuComponent
Is it really a singleton? You can still use UbuntuColors { } right? The qml component doesn't keep track of its instances. Also, the function name may cause some confusion with qmlRegisterSing
Tim Peeters (tpeeters) wrote : | # |
394 public:
395 void registerTypes(const char *uri);
396 void initializeEngin
397 + QUrl baseUrl(QStringList importPathList, const char* uri);
398 + void registerQmlSing
Do they have to be public?
Florian Boucault (fboucault) wrote : | # |
> 367 +void UbuntuComponent
> *engine, const char* uri, const char* typeName, const char* qmlFile)
>
>
> Is it really a singleton? You can still use UbuntuColors { } right? The qml
> component doesn't keep track of its instances. Also, the function name may
> cause some confusion with qmlRegisterSing
> registerQmlCont
You cannot import it nor instantiate it.
The idea of naming it similarly to qmlRegisterSing
Florian Boucault (fboucault) wrote : | # |
> Checkbox and Switch styles use the color #DD4814. Could you replace these by
> UbuntuColors.
Some of the colors where not replaced (such as these ones) on purpose because a separate MR is about to introduce a theme color palette from which these colors will be taken.
Florian Boucault (fboucault) wrote : | # |
> 394 public:
> 395 void registerTypes(const char *uri);
> 396 void initializeEngin
> 397 + QUrl baseUrl(QStringList importPathList, const char* uri);
> 398 + void registerQmlSing
> const char* typeName, const char* qmlFile);
>
> Do they have to be public?
Nobody can nor will instantiate the plugin manually so it does not really matter :)
Florian Boucault (fboucault) wrote : | # |
> UbuntuColors is in the module Ubuntu.Components, which already has Ubuntu in
> the name so instead of Ubuntu.
> colors to Ubuntu.
As a developer you wouldn't readily associate in your mind the Colors object with the Ubuntu color palette, hence the name. The import name is quite distant code wise (as a developer you put it at the beginning of the file and forget it) and does not really help making the connection.
Florian Boucault (fboucault) wrote : | # |
> > UbuntuColors is in the module Ubuntu.Components, which already has Ubuntu in
> > the name so instead of Ubuntu.
> > colors to Ubuntu.
>
> As a developer you wouldn't readily associate in your mind the Colors object
> with the Ubuntu color palette, hence the name. The import name is quite
> distant code wise (as a developer you put it at the beginning of the file and
> forget it) and does not really help making the connection.
A similar reasoning was used for UbuntuAnimation.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:593
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Zsombor Egri (zsombi) wrote : | # |
When closing gallery, the qmlscene does not exit (the prompt in terminal is not retrieved).
Zsombor Egri (zsombi) wrote : | # |
> When closing gallery, the qmlscene does not exit (the prompt in terminal is
> not retrieved).
Actually the following code causes the trouble:
419 +QObject* QuickUtils:
420 +{
421 + /* FIXME: if the directory pointed to by url contains a qmldir file that
422 + declares a JavaScript module then QQmlComponent:
423 + the error "QQmlComponent: Component is not ready".
424 + */
425 + static QQmlEngine engine;
426 + QQmlComponent *component = new QQmlComponent(
427 + QObject* result = component-
428 + delete component;
429 + return result;
430 +}
Having a quick look on the call stack seems to hang on the static QQmlEngien cleanup:
0 pthread_
1 QWaitCondition:
2 ?? /usr/lib/
3 ?? /usr/lib/
4 QQmlEnginePriva
5 QQmlEnginePriva
6 QObject::~QObject() /usr/lib/
7 QQmlEngine:
8 __run_exit_handlers 77 0x7ffff5701121
9 __GI_exit 99 0x7ffff57011a5
10 __libc_start_main 294 0x7ffff56e6eac
11 ?? 0x40629d
So the static QQmlEngine causes the hang when closing qmlscene. I did some small prototyping with using the plugin's QmlEngine, but then a second call on createQmlObject() causes "QQmlComponent: Component not ready" error, which is somewhat anticipated as we are trying to instantiate a component in the plugin's registration stage (we had this kind of error in the early times of the plugin creation with the theming engine).
Connecting the static engine's quit() signal to the parent one's does not help either. Therefore seems we need a different way of creating the UbuntuColors component.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:594
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 595. By Florian Boucault
-
Fixed lockup.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:595
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'debian/qtdeclarative5-ubuntu-ui-toolkit-plugin.install' | |||
2 | --- debian/qtdeclarative5-ubuntu-ui-toolkit-plugin.install 2013-06-27 20:59:19 +0000 | |||
3 | +++ debian/qtdeclarative5-ubuntu-ui-toolkit-plugin.install 2013-07-02 15:41:27 +0000 | |||
4 | @@ -7,3 +7,4 @@ | |||
5 | 7 | usr/lib/*/qt5/qml/Ubuntu/Components/artwork | 7 | usr/lib/*/qt5/qml/Ubuntu/Components/artwork |
6 | 8 | usr/lib/*/qt5/qml/Ubuntu/Components/ListItems | 8 | usr/lib/*/qt5/qml/Ubuntu/Components/ListItems |
7 | 9 | usr/lib/*/qt5/qml/Ubuntu/Components/Popups | 9 | usr/lib/*/qt5/qml/Ubuntu/Components/Popups |
8 | 10 | usr/lib/*/qt5/qml/Ubuntu/Components/Colors | ||
9 | 10 | 11 | ||
10 | === modified file 'examples/ubuntu-ui-toolkit-gallery/AnimationCircle.qml' | |||
11 | --- examples/ubuntu-ui-toolkit-gallery/AnimationCircle.qml 2013-05-14 14:24:25 +0000 | |||
12 | +++ examples/ubuntu-ui-toolkit-gallery/AnimationCircle.qml 2013-07-02 15:41:27 +0000 | |||
13 | @@ -19,7 +19,7 @@ | |||
14 | 19 | Rectangle { | 19 | Rectangle { |
15 | 20 | id: circle | 20 | id: circle |
16 | 21 | 21 | ||
18 | 22 | color: "#dd4814" | 22 | color: UbuntuColors.orange |
19 | 23 | width: radius | 23 | width: radius |
20 | 24 | height: radius | 24 | height: radius |
21 | 25 | radius: units.gu(12) | 25 | radius: units.gu(12) |
22 | 26 | 26 | ||
23 | === modified file 'examples/ubuntu-ui-toolkit-gallery/Dialog.qml' | |||
24 | --- examples/ubuntu-ui-toolkit-gallery/Dialog.qml 2013-04-25 12:34:57 +0000 | |||
25 | +++ examples/ubuntu-ui-toolkit-gallery/Dialog.qml 2013-07-02 15:41:27 +0000 | |||
26 | @@ -47,7 +47,7 @@ | |||
27 | 47 | } | 47 | } |
28 | 48 | Button { | 48 | Button { |
29 | 49 | text: "Delete" | 49 | text: "Delete" |
31 | 50 | color: "red" | 50 | color: UbuntuColors.orange |
32 | 51 | onClicked: PopupUtils.close(dialogue) | 51 | onClicked: PopupUtils.close(dialogue) |
33 | 52 | } | 52 | } |
34 | 53 | } | 53 | } |
35 | 54 | 54 | ||
36 | === modified file 'examples/ubuntu-ui-toolkit-gallery/Icons.qml' | |||
37 | --- examples/ubuntu-ui-toolkit-gallery/Icons.qml 2013-04-24 17:09:29 +0000 | |||
38 | +++ examples/ubuntu-ui-toolkit-gallery/Icons.qml 2013-07-02 15:41:27 +0000 | |||
39 | @@ -58,7 +58,7 @@ | |||
40 | 58 | 58 | ||
41 | 59 | Icon { | 59 | Icon { |
42 | 60 | name: "computer-symbolic" | 60 | name: "computer-symbolic" |
44 | 61 | color: "red" | 61 | color: UbuntuColors.orange |
45 | 62 | keyColor: "#bebebe" | 62 | keyColor: "#bebebe" |
46 | 63 | width: 24 | 63 | width: 24 |
47 | 64 | height: 24 | 64 | height: 24 |
48 | @@ -66,7 +66,7 @@ | |||
49 | 66 | 66 | ||
50 | 67 | Icon { | 67 | Icon { |
51 | 68 | name: "computer-symbolic" | 68 | name: "computer-symbolic" |
53 | 69 | color: "lightblue" | 69 | color: UbuntuColors.lightAubergine |
54 | 70 | keyColor: "#bebebe" | 70 | keyColor: "#bebebe" |
55 | 71 | width: 24 | 71 | width: 24 |
56 | 72 | height: 24 | 72 | height: 24 |
57 | 73 | 73 | ||
58 | === modified file 'examples/ubuntu-ui-toolkit-gallery/UbuntuShape.qml' | |||
59 | --- examples/ubuntu-ui-toolkit-gallery/UbuntuShape.qml 2013-05-21 14:39:57 +0000 | |||
60 | +++ examples/ubuntu-ui-toolkit-gallery/UbuntuShape.qml 2013-07-02 15:41:27 +0000 | |||
61 | @@ -29,17 +29,17 @@ | |||
62 | 29 | 29 | ||
63 | 30 | UbuntuShape { | 30 | UbuntuShape { |
64 | 31 | objectName: "ubuntushape_color_hex" | 31 | objectName: "ubuntushape_color_hex" |
66 | 32 | color: "#5da357" | 32 | color: UbuntuColors.orange |
67 | 33 | } | 33 | } |
68 | 34 | 34 | ||
69 | 35 | UbuntuShape { | 35 | UbuntuShape { |
70 | 36 | objectName: "ubuntushape_color_lightblue" | 36 | objectName: "ubuntushape_color_lightblue" |
72 | 37 | color: "lightblue" | 37 | color: UbuntuColors.lightAubergine |
73 | 38 | } | 38 | } |
74 | 39 | 39 | ||
75 | 40 | UbuntuShape { | 40 | UbuntuShape { |
76 | 41 | objectName: "ubuntushape_color_darkgray" | 41 | objectName: "ubuntushape_color_darkgray" |
78 | 42 | color: "darkgray" | 42 | color: UbuntuColors.warmGrey |
79 | 43 | } | 43 | } |
80 | 44 | } | 44 | } |
81 | 45 | 45 | ||
82 | 46 | 46 | ||
83 | === added directory 'modules/Ubuntu/Components/Colors' | |||
84 | === added file 'modules/Ubuntu/Components/Colors/Colors.pro' | |||
85 | --- modules/Ubuntu/Components/Colors/Colors.pro 1970-01-01 00:00:00 +0000 | |||
86 | +++ modules/Ubuntu/Components/Colors/Colors.pro 2013-07-02 15:41:27 +0000 | |||
87 | @@ -0,0 +1,9 @@ | |||
88 | 1 | TEMPLATE = subdirs | ||
89 | 2 | |||
90 | 3 | uri = Ubuntu.Components.Colors | ||
91 | 4 | installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /) | ||
92 | 5 | |||
93 | 6 | qml_files.path = $$installPath | ||
94 | 7 | qml_files.files = *.qml | ||
95 | 8 | |||
96 | 9 | INSTALLS += qml_files | ||
97 | 0 | 10 | ||
98 | === added file 'modules/Ubuntu/Components/Colors/FIXME' | |||
99 | --- modules/Ubuntu/Components/Colors/FIXME 1970-01-01 00:00:00 +0000 | |||
100 | +++ modules/Ubuntu/Components/Colors/FIXME 2013-07-02 15:41:27 +0000 | |||
101 | @@ -0,0 +1,3 @@ | |||
102 | 1 | UbuntuColors.qml is located in the Colors subdirectory because | ||
103 | 2 | QuickUtils::createQmlObject() fails if the QML file is located in a | ||
104 | 3 | folder that has a qmldir file with JavaScript modules. | ||
105 | 0 | 4 | ||
106 | === added file 'modules/Ubuntu/Components/Colors/UbuntuColors.qml' | |||
107 | --- modules/Ubuntu/Components/Colors/UbuntuColors.qml 1970-01-01 00:00:00 +0000 | |||
108 | +++ modules/Ubuntu/Components/Colors/UbuntuColors.qml 2013-07-02 15:41:27 +0000 | |||
109 | @@ -0,0 +1,63 @@ | |||
110 | 1 | /* | ||
111 | 2 | Copyright 2013 Canonical Ltd. | ||
112 | 3 | * | ||
113 | 4 | This program is free software; you can redistribute it and/or modify | ||
114 | 5 | it under the terms of the GNU Lesser General Public License as published by | ||
115 | 6 | the Free Software Foundation; version 3. | ||
116 | 7 | * | ||
117 | 8 | This program is distributed in the hope that it will be useful, | ||
118 | 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
119 | 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
120 | 11 | GNU Lesser General Public License for more details. | ||
121 | 12 | * | ||
122 | 13 | You should have received a copy of the GNU Lesser General Public License | ||
123 | 14 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
124 | 15 | */ | ||
125 | 16 | |||
126 | 17 | import QtQuick 2.0 | ||
127 | 18 | |||
128 | 19 | /*! | ||
129 | 20 | \qmltype UbuntuColors | ||
130 | 21 | \inqmlmodule Ubuntu.Components 0.1 | ||
131 | 22 | \ingroup theming | ||
132 | 23 | \brief Singleton defining the Ubuntu color palette. | ||
133 | 24 | |||
134 | 25 | Each color of the Ubuntu color palette is accesible from it. | ||
135 | 26 | For more information on how to appropriately use the colors according to | ||
136 | 27 | the context, please refer to the | ||
137 | 28 | \l{http://design.ubuntu.com/brand/colour-palette}{Ubuntu brand guidelines}. | ||
138 | 29 | |||
139 | 30 | Example of use: | ||
140 | 31 | |||
141 | 32 | \qml | ||
142 | 33 | Rectangle { | ||
143 | 34 | color: UbuntuColors.orange | ||
144 | 35 | } | ||
145 | 36 | \endqml | ||
146 | 37 | */ | ||
147 | 38 | QtObject { | ||
148 | 39 | /*! | ||
149 | 40 | Ubuntu core color: Ubuntu orange | ||
150 | 41 | */ | ||
151 | 42 | readonly property color orange: "#DD4814" | ||
152 | 43 | /*! | ||
153 | 44 | Ubuntu supporting color: light aubergine | ||
154 | 45 | */ | ||
155 | 46 | readonly property color lightAubergine: "#77216F" | ||
156 | 47 | /*! | ||
157 | 48 | Ubuntu supporting color: mid aubergine | ||
158 | 49 | */ | ||
159 | 50 | readonly property color midAubergine: "#5E2750" | ||
160 | 51 | /*! | ||
161 | 52 | Ubuntu supporting color: dark aubergine | ||
162 | 53 | */ | ||
163 | 54 | readonly property color darkAubergine: "#2C001E" | ||
164 | 55 | /*! | ||
165 | 56 | Ubuntu neutral color: warm grey | ||
166 | 57 | */ | ||
167 | 58 | readonly property color warmGrey: "#AEA79F" | ||
168 | 59 | /*! | ||
169 | 60 | Ubuntu neutral color: cool grey | ||
170 | 61 | */ | ||
171 | 62 | readonly property color coolGrey: "#333333" | ||
172 | 63 | } | ||
173 | 0 | 64 | ||
174 | === modified file 'modules/Ubuntu/Components/Components.pro' | |||
175 | --- modules/Ubuntu/Components/Components.pro 2013-06-30 13:04:37 +0000 | |||
176 | +++ modules/Ubuntu/Components/Components.pro 2013-07-02 15:41:27 +0000 | |||
177 | @@ -1,5 +1,5 @@ | |||
178 | 1 | TEMPLATE = subdirs | 1 | TEMPLATE = subdirs |
179 | 2 | 2 | ||
181 | 3 | SUBDIRS += plugin Themes | 3 | SUBDIRS += plugin Themes Colors |
182 | 4 | 4 | ||
183 | 5 | include(deployment.pri) | 5 | include(deployment.pri) |
184 | 6 | 6 | ||
185 | === modified file 'modules/Ubuntu/Components/Icon.qml' | |||
186 | --- modules/Ubuntu/Components/Icon.qml 2013-04-11 01:18:01 +0000 | |||
187 | +++ modules/Ubuntu/Components/Icon.qml 2013-07-02 15:41:27 +0000 | |||
188 | @@ -45,7 +45,7 @@ | |||
189 | 45 | width: 64 | 45 | width: 64 |
190 | 46 | height: 64 | 46 | height: 64 |
191 | 47 | name: "search" | 47 | name: "search" |
193 | 48 | color: "red" | 48 | color: UbuntuColors.warmGrey |
194 | 49 | } | 49 | } |
195 | 50 | \endqml | 50 | \endqml |
196 | 51 | 51 | ||
197 | 52 | 52 | ||
198 | === modified file 'modules/Ubuntu/Components/Label.qml' | |||
199 | --- modules/Ubuntu/Components/Label.qml 2013-06-26 19:25:09 +0000 | |||
200 | +++ modules/Ubuntu/Components/Label.qml 2013-07-02 15:41:27 +0000 | |||
201 | @@ -25,7 +25,7 @@ | |||
202 | 25 | Example: | 25 | Example: |
203 | 26 | \qml | 26 | \qml |
204 | 27 | Rectangle { | 27 | Rectangle { |
206 | 28 | color: "grey" | 28 | color: UbuntuColors.coolGrey |
207 | 29 | width: units.gu(30) | 29 | width: units.gu(30) |
208 | 30 | height: units.gu(30) | 30 | height: units.gu(30) |
209 | 31 | 31 | ||
210 | @@ -56,5 +56,5 @@ | |||
211 | 56 | 56 | ||
212 | 57 | font.pixelSize: FontUtils.sizeToPixels(fontSize) | 57 | font.pixelSize: FontUtils.sizeToPixels(fontSize) |
213 | 58 | font.family: "Ubuntu" | 58 | font.family: "Ubuntu" |
215 | 59 | color: "#757373" | 59 | color: UbuntuColors.coolGrey |
216 | 60 | } | 60 | } |
217 | 61 | 61 | ||
218 | === modified file 'modules/Ubuntu/Components/ListItems/LabelVisual.qml' | |||
219 | --- modules/Ubuntu/Components/ListItems/LabelVisual.qml 2012-12-07 13:43:17 +0000 | |||
220 | +++ modules/Ubuntu/Components/ListItems/LabelVisual.qml 2013-07-02 15:41:27 +0000 | |||
221 | @@ -24,6 +24,6 @@ | |||
222 | 24 | 24 | ||
223 | 25 | fontSize: "medium" | 25 | fontSize: "medium" |
224 | 26 | elide: Text.ElideRight | 26 | elide: Text.ElideRight |
226 | 27 | color: selected ? "#f37505" : Qt.rgba(0.4, 0.4, 0.4, 1.0) | 27 | color: selected ? UbuntuColors.orange : Qt.rgba(0.4, 0.4, 0.4, 1.0) |
227 | 28 | opacity: label.enabled ? 1.0 : 0.5 | 28 | opacity: label.enabled ? 1.0 : 0.5 |
228 | 29 | } | 29 | } |
229 | 30 | 30 | ||
230 | === modified file 'modules/Ubuntu/Components/MainView.qml' | |||
231 | --- modules/Ubuntu/Components/MainView.qml 2013-06-27 15:20:12 +0000 | |||
232 | +++ modules/Ubuntu/Components/MainView.qml 2013-07-02 15:41:27 +0000 | |||
233 | @@ -99,20 +99,20 @@ | |||
234 | 99 | anchors.centerIn: parent | 99 | anchors.centerIn: parent |
235 | 100 | width: units.gu(20) | 100 | width: units.gu(20) |
236 | 101 | height: units.gu(20) | 101 | height: units.gu(20) |
238 | 102 | color: "blue" | 102 | color: UbuntuColors.coolGrey |
239 | 103 | } | 103 | } |
240 | 104 | 104 | ||
241 | 105 | tools: ToolbarActions { | 105 | tools: ToolbarActions { |
242 | 106 | ToolbarButton { | 106 | ToolbarButton { |
243 | 107 | action: Action { | 107 | action: Action { |
244 | 108 | text: "red" | 108 | text: "red" |
246 | 109 | onTriggered: rectangle.color = "red" | 109 | onTriggered: rectangle.color = UbuntuColors.orange |
247 | 110 | } | 110 | } |
248 | 111 | } | 111 | } |
249 | 112 | ToolbarButton { | 112 | ToolbarButton { |
250 | 113 | action: Action { | 113 | action: Action { |
251 | 114 | text: "green" | 114 | text: "green" |
253 | 115 | onTriggered: rectangle.color = "green" | 115 | onTriggered: rectangle.color = UbuntuColors.lightAubergine |
254 | 116 | } | 116 | } |
255 | 117 | } | 117 | } |
256 | 118 | } | 118 | } |
257 | 119 | 119 | ||
258 | === modified file 'modules/Ubuntu/Components/PageStack.qml' | |||
259 | --- modules/Ubuntu/Components/PageStack.qml 2013-04-04 10:26:43 +0000 | |||
260 | +++ modules/Ubuntu/Components/PageStack.qml 2013-07-02 15:41:27 +0000 | |||
261 | @@ -59,7 +59,7 @@ | |||
262 | 59 | anchors.fill: parent | 59 | anchors.fill: parent |
263 | 60 | ListItem.Standard { | 60 | ListItem.Standard { |
264 | 61 | text: i18n.tr("Page one") | 61 | text: i18n.tr("Page one") |
266 | 62 | onClicked: pageStack.push(page1, {color: "red"}) | 62 | onClicked: pageStack.push(page1, {color: UbuntuColors.orange}) |
267 | 63 | progression: true | 63 | progression: true |
268 | 64 | } | 64 | } |
269 | 65 | ListItem.Standard { | 65 | ListItem.Standard { |
270 | 66 | 66 | ||
271 | === modified file 'modules/Ubuntu/Components/Popups/ComposerSheet.qml' | |||
272 | --- modules/Ubuntu/Components/Popups/ComposerSheet.qml 2012-11-29 18:13:17 +0000 | |||
273 | +++ modules/Ubuntu/Components/Popups/ComposerSheet.qml 2013-07-02 15:41:27 +0000 | |||
274 | @@ -84,7 +84,7 @@ | |||
275 | 84 | 84 | ||
276 | 85 | __rightButton: Button { | 85 | __rightButton: Button { |
277 | 86 | text: i18n.dtr("ubuntu-sdk", "confirm") | 86 | text: i18n.dtr("ubuntu-sdk", "confirm") |
279 | 87 | color: "#5da357" | 87 | color: UbuntuColors.orange |
280 | 88 | /*! \internal */ // avoid warning when generating documentation | 88 | /*! \internal */ // avoid warning when generating documentation |
281 | 89 | onClicked: { | 89 | onClicked: { |
282 | 90 | composer.confirmClicked(); | 90 | composer.confirmClicked(); |
283 | 91 | 91 | ||
284 | === modified file 'modules/Ubuntu/Components/Popups/DefaultSheet.qml' | |||
285 | --- modules/Ubuntu/Components/Popups/DefaultSheet.qml 2012-11-29 18:13:17 +0000 | |||
286 | +++ modules/Ubuntu/Components/Popups/DefaultSheet.qml 2013-07-02 15:41:27 +0000 | |||
287 | @@ -93,7 +93,7 @@ | |||
288 | 93 | 93 | ||
289 | 94 | __rightButton: Button { | 94 | __rightButton: Button { |
290 | 95 | text: i18n.dtr("ubuntu-sdk", "done") | 95 | text: i18n.dtr("ubuntu-sdk", "done") |
292 | 96 | color: "#5da357" | 96 | color: UbuntuColors.orange |
293 | 97 | visible: doneButton | 97 | visible: doneButton |
294 | 98 | /*! \internal */ | 98 | /*! \internal */ |
295 | 99 | onClicked: { | 99 | onClicked: { |
296 | 100 | 100 | ||
297 | === modified file 'modules/Ubuntu/Components/Popups/Dialog.qml' | |||
298 | --- modules/Ubuntu/Components/Popups/Dialog.qml 2013-06-27 15:20:12 +0000 | |||
299 | +++ modules/Ubuntu/Components/Popups/Dialog.qml 2013-07-02 15:41:27 +0000 | |||
300 | @@ -48,12 +48,12 @@ | |||
301 | 48 | } | 48 | } |
302 | 49 | Button { | 49 | Button { |
303 | 50 | text: "overwrite previous version" | 50 | text: "overwrite previous version" |
305 | 51 | color: "orange" | 51 | color: UbuntuColors.orange |
306 | 52 | onClicked: PopupUtils.close(dialogue) | 52 | onClicked: PopupUtils.close(dialogue) |
307 | 53 | } | 53 | } |
308 | 54 | Button { | 54 | Button { |
309 | 55 | text: "save a copy" | 55 | text: "save a copy" |
311 | 56 | color: "orange" | 56 | color: UbuntuColors.orange |
312 | 57 | onClicked: PopupUtils.close(dialogue) | 57 | onClicked: PopupUtils.close(dialogue) |
313 | 58 | } | 58 | } |
314 | 59 | } | 59 | } |
315 | 60 | 60 | ||
316 | === modified file 'modules/Ubuntu/Components/Themes/Ambiance/TextAreaStyle.qml' | |||
317 | --- modules/Ubuntu/Components/Themes/Ambiance/TextAreaStyle.qml 2013-06-27 18:04:07 +0000 | |||
318 | +++ modules/Ubuntu/Components/Themes/Ambiance/TextAreaStyle.qml 2013-07-02 15:41:27 +0000 | |||
319 | @@ -30,7 +30,7 @@ | |||
320 | 30 | Background fill color | 30 | Background fill color |
321 | 31 | */ | 31 | */ |
322 | 32 | property color backgroundColor: (styledItem.focus || styledItem.highlighted) ? "white" : Qt.rgba(0, 0, 0, 0.1) | 32 | property color backgroundColor: (styledItem.focus || styledItem.highlighted) ? "white" : Qt.rgba(0, 0, 0, 0.1) |
324 | 33 | property color errorColor: "red" | 33 | property color errorColor: UbuntuColors.orange |
325 | 34 | property real backgroundOpacity: styledItem.enabled ? 1.0 : 0.1 | 34 | property real backgroundOpacity: styledItem.enabled ? 1.0 : 0.1 |
326 | 35 | 35 | ||
327 | 36 | /*! | 36 | /*! |
328 | 37 | 37 | ||
329 | === modified file 'modules/Ubuntu/Components/UbuntuNumberAnimation.qml' | |||
330 | --- modules/Ubuntu/Components/UbuntuNumberAnimation.qml 2013-05-14 13:09:44 +0000 | |||
331 | +++ modules/Ubuntu/Components/UbuntuNumberAnimation.qml 2013-07-02 15:41:27 +0000 | |||
332 | @@ -33,7 +33,7 @@ | |||
333 | 33 | 33 | ||
334 | 34 | Rectangle { | 34 | Rectangle { |
335 | 35 | width: 100; height: 100 | 35 | width: 100; height: 100 |
337 | 36 | color: "red" | 36 | color: UbuntuColors.orange |
338 | 37 | 37 | ||
339 | 38 | UbuntuNumberAnimation on x { to: 50 } | 38 | UbuntuNumberAnimation on x { to: 50 } |
340 | 39 | } | 39 | } |
341 | 40 | 40 | ||
342 | === modified file 'modules/Ubuntu/Components/plugin/plugin.cpp' | |||
343 | --- modules/Ubuntu/Components/plugin/plugin.cpp 2013-07-01 22:13:31 +0000 | |||
344 | +++ modules/Ubuntu/Components/plugin/plugin.cpp 2013-07-02 15:41:27 +0000 | |||
345 | @@ -58,6 +58,33 @@ | |||
346 | 58 | return clipboard; | 58 | return clipboard; |
347 | 59 | } | 59 | } |
348 | 60 | 60 | ||
349 | 61 | |||
350 | 62 | QUrl UbuntuComponentsPlugin::baseUrl(QStringList importPathList, const char* uri) | ||
351 | 63 | { | ||
352 | 64 | /* FIXME: remove when migrating to Qt 5.1 and use QQmlExtensionPlugin::baseUrl() | ||
353 | 65 | http://doc-snapshot.qt-project.org/qt5-stable/qtqml/qqmlextensionplugin.html#baseUrl | ||
354 | 66 | */ | ||
355 | 67 | QString pluginRelativePath = QString::fromUtf8(uri).replace(".", "/").prepend("/").append("/"); | ||
356 | 68 | QString pluginPath; | ||
357 | 69 | Q_FOREACH (QString importPath, importPathList) { | ||
358 | 70 | pluginPath = importPath.append(pluginRelativePath); | ||
359 | 71 | if (QDir(pluginPath).exists()) { | ||
360 | 72 | return QUrl::fromLocalFile(pluginPath); | ||
361 | 73 | } | ||
362 | 74 | } | ||
363 | 75 | |||
364 | 76 | return QUrl(); | ||
365 | 77 | } | ||
366 | 78 | |||
367 | 79 | void UbuntuComponentsPlugin::registerQmlSingletonType(QQmlEngine *engine, const char* uri, const char* typeName, const char* qmlFile) | ||
368 | 80 | { | ||
369 | 81 | QUrl url = baseUrl(engine->importPathList(), uri).resolved(QUrl::fromLocalFile(qmlFile)); | ||
370 | 82 | QObject* object = QuickUtils::instance().createQmlObject(url); | ||
371 | 83 | if (object != NULL) { | ||
372 | 84 | engine->rootContext()->setContextProperty(typeName, object); | ||
373 | 85 | } | ||
374 | 86 | } | ||
375 | 87 | |||
376 | 61 | void UbuntuComponentsPlugin::registerTypes(const char *uri) | 88 | void UbuntuComponentsPlugin::registerTypes(const char *uri) |
377 | 62 | { | 89 | { |
378 | 63 | Q_ASSERT(uri == QLatin1String("Ubuntu.Components")); | 90 | Q_ASSERT(uri == QLatin1String("Ubuntu.Components")); |
379 | @@ -108,6 +135,9 @@ | |||
380 | 108 | 135 | ||
381 | 109 | context->setContextProperty("bottomBarVisibilityCommunicator", &BottomBarVisibilityCommunicator::instance()); | 136 | context->setContextProperty("bottomBarVisibilityCommunicator", &BottomBarVisibilityCommunicator::instance()); |
382 | 110 | 137 | ||
383 | 138 | // register UbuntuColors | ||
384 | 139 | registerQmlSingletonType(engine, uri, "UbuntuColors", "Colors/UbuntuColors.qml"); | ||
385 | 140 | |||
386 | 111 | engine->addImageProvider(QLatin1String("scaling"), new UCScalingImageProvider); | 141 | engine->addImageProvider(QLatin1String("scaling"), new UCScalingImageProvider); |
387 | 112 | 142 | ||
388 | 113 | // register gicon provider | 143 | // register gicon provider |
389 | 114 | 144 | ||
390 | === modified file 'modules/Ubuntu/Components/plugin/plugin.h' | |||
391 | --- modules/Ubuntu/Components/plugin/plugin.h 2012-10-25 13:35:32 +0000 | |||
392 | +++ modules/Ubuntu/Components/plugin/plugin.h 2013-07-02 15:41:27 +0000 | |||
393 | @@ -30,6 +30,8 @@ | |||
394 | 30 | public: | 30 | public: |
395 | 31 | void registerTypes(const char *uri); | 31 | void registerTypes(const char *uri); |
396 | 32 | void initializeEngine(QQmlEngine *engine, const char *uri); | 32 | void initializeEngine(QQmlEngine *engine, const char *uri); |
397 | 33 | QUrl baseUrl(QStringList importPathList, const char* uri); | ||
398 | 34 | void registerQmlSingletonType(QQmlEngine *engine, const char* uri, const char* typeName, const char* qmlFile); | ||
399 | 33 | }; | 35 | }; |
400 | 34 | #endif // UBUNTU_COMPONENTS_PLUGIN_H | 36 | #endif // UBUNTU_COMPONENTS_PLUGIN_H |
401 | 35 | 37 | ||
402 | 36 | 38 | ||
403 | === modified file 'modules/Ubuntu/Components/plugin/quickutils.cpp' | |||
404 | --- modules/Ubuntu/Components/plugin/quickutils.cpp 2013-05-27 09:48:42 +0000 | |||
405 | +++ modules/Ubuntu/Components/plugin/quickutils.cpp 2013-07-02 15:41:27 +0000 | |||
406 | @@ -25,13 +25,15 @@ | |||
407 | 25 | #include <QtCore/QAbstractProxyModel> | 25 | #include <QtCore/QAbstractProxyModel> |
408 | 26 | #include <QtQml/QQmlPropertyMap> | 26 | #include <QtQml/QQmlPropertyMap> |
409 | 27 | #include <QtQml/QQmlInfo> | 27 | #include <QtQml/QQmlInfo> |
410 | 28 | #include <QtQml/QQmlEngine> | ||
411 | 28 | 29 | ||
412 | 29 | #include <private/qquicktextinput_p.h> | 30 | #include <private/qquicktextinput_p.h> |
413 | 30 | #include <private/qquicktextedit_p.h> | 31 | #include <private/qquicktextedit_p.h> |
414 | 31 | 32 | ||
415 | 32 | QuickUtils::QuickUtils(QObject *parent) : | 33 | QuickUtils::QuickUtils(QObject *parent) : |
416 | 33 | QObject(parent), | 34 | QObject(parent), |
418 | 34 | m_rootView(0) | 35 | m_rootView(0), |
419 | 36 | m_engine(new QQmlEngine) | ||
420 | 35 | { | 37 | { |
421 | 36 | QGuiApplication::instance()->installEventFilter(this); | 38 | QGuiApplication::instance()->installEventFilter(this); |
422 | 37 | // connect to focusObjectChanged() to get the latest active focus object | 39 | // connect to focusObjectChanged() to get the latest active focus object |
423 | @@ -231,3 +233,15 @@ | |||
424 | 231 | } | 233 | } |
425 | 232 | } | 234 | } |
426 | 233 | } | 235 | } |
427 | 236 | |||
428 | 237 | QObject* QuickUtils::createQmlObject(const QUrl &url) | ||
429 | 238 | { | ||
430 | 239 | /* FIXME: if the directory pointed to by url contains a qmldir file that | ||
431 | 240 | declares a JavaScript module then QQmlComponent::create() fails with | ||
432 | 241 | the error "QQmlComponent: Component is not ready". | ||
433 | 242 | */ | ||
434 | 243 | QQmlComponent *component = new QQmlComponent(m_engine, url, QQmlComponent::PreferSynchronous); | ||
435 | 244 | QObject* result = component->create(); | ||
436 | 245 | delete component; | ||
437 | 246 | return result; | ||
438 | 247 | } | ||
439 | 234 | 248 | ||
440 | === modified file 'modules/Ubuntu/Components/plugin/quickutils.h' | |||
441 | --- modules/Ubuntu/Components/plugin/quickutils.h 2013-05-24 10:07:44 +0000 | |||
442 | +++ modules/Ubuntu/Components/plugin/quickutils.h 2013-07-02 15:41:27 +0000 | |||
443 | @@ -43,6 +43,7 @@ | |||
444 | 43 | 43 | ||
445 | 44 | Q_INVOKABLE qreal modelDelegateHeight(QQmlComponent *delegate, const QVariant &model); | 44 | Q_INVOKABLE qreal modelDelegateHeight(QQmlComponent *delegate, const QVariant &model); |
446 | 45 | Q_INVOKABLE QString className(QQuickItem *item); | 45 | Q_INVOKABLE QString className(QQuickItem *item); |
447 | 46 | QObject* createQmlObject(const QUrl &url); | ||
448 | 46 | 47 | ||
449 | 47 | Q_SIGNALS: | 48 | Q_SIGNALS: |
450 | 48 | void rootObjectChanged(); | 49 | void rootObjectChanged(); |
451 | @@ -56,6 +57,7 @@ | |||
452 | 56 | private: | 57 | private: |
453 | 57 | explicit QuickUtils(QObject *parent = 0); | 58 | explicit QuickUtils(QObject *parent = 0); |
454 | 58 | QQuickView *m_rootView; | 59 | QQuickView *m_rootView; |
455 | 60 | QQmlEngine *m_engine; | ||
456 | 59 | 61 | ||
457 | 60 | void lookupQuickView(); | 62 | void lookupQuickView(); |
458 | 61 | }; | 63 | }; |
Checkbox and Switch styles use the color #DD4814. Could you replace these by UbuntuColors. orange?