Merge lp:~lukas-kde/qtubuntu/ubuntuIconsFonts into lp:qtubuntu
- ubuntuIconsFonts
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Daniel d'Andrada | ||||
Approved revision: | 388 | ||||
Merged at revision: | 392 | ||||
Proposed branch: | lp:~lukas-kde/qtubuntu/ubuntuIconsFonts | ||||
Merge into: | lp:qtubuntu | ||||
Diff against target: |
236 lines (+77/-53) 6 files modified
src/shared/ubuntutheme.h (+63/-0) src/ubuntuappmenu/theme.cpp (+3/-20) src/ubuntuappmenu/theme.h (+4/-7) src/ubuntuappmenu/ubuntuappmenu.pro (+2/-1) src/ubuntumirclient/qmirclientintegration.cpp (+3/-24) src/ubuntumirclient/ubuntumirclient.pro (+2/-1) |
||||
To merge this branch: | bzr merge lp:~lukas-kde/qtubuntu/ubuntuIconsFonts | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel d'Andrada (community) | Approve | ||
Unity8 CI Bot | continuous-integration | Approve | |
Review via email: mp+321178@code.launchpad.net |
Commit message
Use the correct font (Ubuntu family) and icon theme (suru)
Description of the change
Use the correct font (Ubuntu family) and icon theme (suru)
Together with the logicalDPI branch (https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
Daniel d'Andrada (dandrader) wrote : | # |
Please update the copyright header of the modified files.
Daniel d'Andrada (dandrader) wrote : | # |
"""
private:
QFont systemFont, fixedFont;
"""
Should follow the project's naming convention for member variables. Eg:
s/systemFont/
Daniel d'Andrada (dandrader) wrote : | # |
Other than that it looks good and works as expected.
- 386. By Lukáš Tinkl
-
update (c), prefix private member with "m"
Lukáš Tinkl (lukas-kde) wrote : | # |
> Please update the copyright header of the modified files.
Done
Lukáš Tinkl (lukas-kde) wrote : | # |
> """
> private:
> QFont systemFont, fixedFont;
> """
>
> Should follow the project's naming convention for member variables. Eg:
> s/systemFont/
Fixed
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:386
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Daniel d'Andrada (dandrader) wrote : | # |
Looking at the diff again, don't know why I missed that before:
Would it be possible for ubuntuappmenu and ubuntumirclient to share the very same theme class? Better than copy-pasting code around.
Lukáš Tinkl (lukas-kde) wrote : | # |
> Looking at the diff again, don't know why I missed that before:
> Would it be possible for ubuntuappmenu and ubuntumirclient to share the very
> same theme class? Better than copy-pasting code around.
Yeah, was wondering the same, I can give it a try
- 387. By Lukáš Tinkl
-
factor out the common QPlatformTheme bits into a shared header file
Lukáš Tinkl (lukas-kde) wrote : | # |
> Looking at the diff again, don't know why I missed that before:
> Would it be possible for ubuntuappmenu and ubuntumirclient to share the very
> same theme class? Better than copy-pasting code around.
Alright, the QPlatformTheme code is now shared between the two plugins (the common stuff)
Daniel d'Andrada (dandrader) wrote : | # |
Much better. Last bit:
s/UbuntuIconThe
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:387
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 388. By Lukáš Tinkl
-
s/UbuntuIconThe
me/UbuntuTheme
Lukáš Tinkl (lukas-kde) wrote : | # |
> Much better. Last bit:
> s/UbuntuIconThe
Done
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:388
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === added directory 'src/shared' | |||
2 | === added file 'src/shared/ubuntutheme.h' | |||
3 | --- src/shared/ubuntutheme.h 1970-01-01 00:00:00 +0000 | |||
4 | +++ src/shared/ubuntutheme.h 2017-03-29 14:17:03 +0000 | |||
5 | @@ -0,0 +1,63 @@ | |||
6 | 1 | /* | ||
7 | 2 | * Copyright (C) 2016-2017 Canonical, Ltd. | ||
8 | 3 | * | ||
9 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
10 | 5 | * the terms of the GNU Lesser General Public License version 3, as published by | ||
11 | 6 | * the Free Software Foundation. | ||
12 | 7 | * | ||
13 | 8 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
14 | 9 | * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, | ||
15 | 10 | * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | 11 | * Lesser General Public License for more details. | ||
17 | 12 | * | ||
18 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
19 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
20 | 15 | */ | ||
21 | 16 | |||
22 | 17 | #include <QVariant> | ||
23 | 18 | #include <QtPlatformSupport/private/qgenericunixthemes_p.h> | ||
24 | 19 | |||
25 | 20 | class UbuntuTheme : public QGenericUnixTheme | ||
26 | 21 | { | ||
27 | 22 | public: | ||
28 | 23 | UbuntuTheme() | ||
29 | 24 | : mSystemFont(QStringLiteral("Ubuntu Regular"), 10), | ||
30 | 25 | mFixedFont(QStringLiteral("Ubuntu Mono Regular"), 13) | ||
31 | 26 | { | ||
32 | 27 | mSystemFont.setStyleHint(QFont::System); | ||
33 | 28 | mFixedFont.setStyleHint(QFont::TypeWriter); | ||
34 | 29 | } | ||
35 | 30 | ~UbuntuTheme() = default; | ||
36 | 31 | |||
37 | 32 | QVariant themeHint(ThemeHint hint) const override | ||
38 | 33 | { | ||
39 | 34 | switch (hint) { | ||
40 | 35 | case QPlatformTheme::SystemIconThemeName: { | ||
41 | 36 | QByteArray iconTheme = qgetenv("QTUBUNTU_ICON_THEME"); | ||
42 | 37 | if (iconTheme.isEmpty()) { | ||
43 | 38 | return QStringLiteral("suru"); | ||
44 | 39 | } else { | ||
45 | 40 | return iconTheme; | ||
46 | 41 | } | ||
47 | 42 | } | ||
48 | 43 | default: | ||
49 | 44 | break; | ||
50 | 45 | } | ||
51 | 46 | return QGenericUnixTheme::themeHint(hint); | ||
52 | 47 | } | ||
53 | 48 | |||
54 | 49 | const QFont *font(Font type) const override | ||
55 | 50 | { | ||
56 | 51 | switch (type) { | ||
57 | 52 | case QPlatformTheme::SystemFont: | ||
58 | 53 | return &mSystemFont; | ||
59 | 54 | case QPlatformTheme::FixedFont: | ||
60 | 55 | return &mFixedFont; | ||
61 | 56 | default: | ||
62 | 57 | return nullptr; | ||
63 | 58 | } | ||
64 | 59 | } | ||
65 | 60 | |||
66 | 61 | private: | ||
67 | 62 | QFont mSystemFont, mFixedFont; | ||
68 | 63 | }; | ||
69 | 0 | 64 | ||
70 | === modified file 'src/ubuntuappmenu/theme.cpp' | |||
71 | --- src/ubuntuappmenu/theme.cpp 2017-02-16 13:33:03 +0000 | |||
72 | +++ src/ubuntuappmenu/theme.cpp 2017-03-29 14:17:03 +0000 | |||
73 | @@ -1,5 +1,5 @@ | |||
74 | 1 | /* | 1 | /* |
76 | 2 | * Copyright (C) 2016 Canonical, Ltd. | 2 | * Copyright (C) 2016-2017 Canonical, Ltd. |
77 | 3 | * | 3 | * |
78 | 4 | * This program is free software: you can redistribute it and/or modify it under | 4 | * This program is free software: you can redistribute it and/or modify it under |
79 | 5 | * the terms of the GNU Lesser General Public License version 3, as published by | 5 | * the terms of the GNU Lesser General Public License version 3, as published by |
80 | @@ -34,29 +34,12 @@ | |||
81 | 34 | 34 | ||
82 | 35 | } | 35 | } |
83 | 36 | 36 | ||
85 | 37 | UbuntuAppMenuTheme::UbuntuAppMenuTheme() | 37 | UbuntuAppMenuTheme::UbuntuAppMenuTheme(): |
86 | 38 | UbuntuTheme() | ||
87 | 38 | { | 39 | { |
88 | 39 | qCDebug(ubuntuappmenu, "UbuntuAppMenuTheme::UbuntuAppMenuTheme() - useLocalMenu=%s", useLocalMenu() ? "true" : "false"); | 40 | qCDebug(ubuntuappmenu, "UbuntuAppMenuTheme::UbuntuAppMenuTheme() - useLocalMenu=%s", useLocalMenu() ? "true" : "false"); |
89 | 40 | } | 41 | } |
90 | 41 | 42 | ||
91 | 42 | UbuntuAppMenuTheme::~UbuntuAppMenuTheme() | ||
92 | 43 | { | ||
93 | 44 | } | ||
94 | 45 | |||
95 | 46 | QVariant UbuntuAppMenuTheme::themeHint(ThemeHint hint) const | ||
96 | 47 | { | ||
97 | 48 | if (hint == QPlatformTheme::SystemIconThemeName) { | ||
98 | 49 | QByteArray iconTheme = qgetenv("QTUBUNTU_ICON_THEME"); | ||
99 | 50 | if (iconTheme.isEmpty()) { | ||
100 | 51 | return QVariant(QStringLiteral("ubuntu-mobile")); | ||
101 | 52 | } else { | ||
102 | 53 | return QVariant(QString(iconTheme)); | ||
103 | 54 | } | ||
104 | 55 | } else { | ||
105 | 56 | return QGenericUnixTheme::themeHint(hint); | ||
106 | 57 | } | ||
107 | 58 | } | ||
108 | 59 | |||
109 | 60 | QPlatformMenuItem *UbuntuAppMenuTheme::createPlatformMenuItem() const | 43 | QPlatformMenuItem *UbuntuAppMenuTheme::createPlatformMenuItem() const |
110 | 61 | { | 44 | { |
111 | 62 | if (useLocalMenu()) return QGenericUnixTheme::createPlatformMenuItem(); | 45 | if (useLocalMenu()) return QGenericUnixTheme::createPlatformMenuItem(); |
112 | 63 | 46 | ||
113 | === modified file 'src/ubuntuappmenu/theme.h' | |||
114 | --- src/ubuntuappmenu/theme.h 2017-02-16 13:33:03 +0000 | |||
115 | +++ src/ubuntuappmenu/theme.h 2017-03-29 14:17:03 +0000 | |||
116 | @@ -1,5 +1,5 @@ | |||
117 | 1 | /* | 1 | /* |
119 | 2 | * Copyright (C) 2016 Canonical, Ltd. | 2 | * Copyright (C) 2016-2017 Canonical, Ltd. |
120 | 3 | * | 3 | * |
121 | 4 | * This program is free software: you can redistribute it and/or modify it under | 4 | * This program is free software: you can redistribute it and/or modify it under |
122 | 5 | * the terms of the GNU Lesser General Public License version 3, as published by | 5 | * the terms of the GNU Lesser General Public License version 3, as published by |
123 | @@ -17,17 +17,14 @@ | |||
124 | 17 | #ifndef UBUNTU_THEME_H | 17 | #ifndef UBUNTU_THEME_H |
125 | 18 | #define UBUNTU_THEME_H | 18 | #define UBUNTU_THEME_H |
126 | 19 | 19 | ||
128 | 20 | #include <QtPlatformSupport/private/qgenericunixthemes_p.h> | 20 | #include "../shared/ubuntutheme.h" |
129 | 21 | 21 | ||
131 | 22 | class UbuntuAppMenuTheme : public QGenericUnixTheme | 22 | class UbuntuAppMenuTheme : public UbuntuTheme |
132 | 23 | { | 23 | { |
133 | 24 | public: | 24 | public: |
134 | 25 | static const char* name; | 25 | static const char* name; |
135 | 26 | UbuntuAppMenuTheme(); | 26 | UbuntuAppMenuTheme(); |
140 | 27 | virtual ~UbuntuAppMenuTheme(); | 27 | ~UbuntuAppMenuTheme() = default; |
137 | 28 | |||
138 | 29 | // From QPlatformTheme | ||
139 | 30 | QVariant themeHint(ThemeHint hint) const override; | ||
141 | 31 | 28 | ||
142 | 32 | // For the menus | 29 | // For the menus |
143 | 33 | QPlatformMenuItem* createPlatformMenuItem() const override; | 30 | QPlatformMenuItem* createPlatformMenuItem() const override; |
144 | 34 | 31 | ||
145 | === modified file 'src/ubuntuappmenu/ubuntuappmenu.pro' | |||
146 | --- src/ubuntuappmenu/ubuntuappmenu.pro 2017-03-06 15:28:00 +0000 | |||
147 | +++ src/ubuntuappmenu/ubuntuappmenu.pro 2017-03-29 14:17:03 +0000 | |||
148 | @@ -23,7 +23,8 @@ | |||
149 | 23 | menuregistrar.h \ | 23 | menuregistrar.h \ |
150 | 24 | registry.h \ | 24 | registry.h \ |
151 | 25 | themeplugin.h \ | 25 | themeplugin.h \ |
153 | 26 | qtubuntuextraactionhandler.h | 26 | qtubuntuextraactionhandler.h \ |
154 | 27 | ../shared/ubuntutheme.h | ||
155 | 27 | 28 | ||
156 | 28 | SOURCES += \ | 29 | SOURCES += \ |
157 | 29 | theme.cpp \ | 30 | theme.cpp \ |
158 | 30 | 31 | ||
159 | === modified file 'src/ubuntumirclient/qmirclientintegration.cpp' | |||
160 | --- src/ubuntumirclient/qmirclientintegration.cpp 2017-02-07 15:37:20 +0000 | |||
161 | +++ src/ubuntumirclient/qmirclientintegration.cpp 2017-03-29 14:17:03 +0000 | |||
162 | @@ -1,6 +1,6 @@ | |||
163 | 1 | /**************************************************************************** | 1 | /**************************************************************************** |
164 | 2 | ** | 2 | ** |
166 | 3 | ** Copyright (C) 2014-2016 Canonical, Ltd. | 3 | ** Copyright (C) 2014-2017 Canonical, Ltd. |
167 | 4 | ** Contact: https://www.qt.io/licensing/ | 4 | ** Contact: https://www.qt.io/licensing/ |
168 | 5 | ** | 5 | ** |
169 | 6 | ** This file is part of the plugins of the Qt Toolkit. | 6 | ** This file is part of the plugins of the Qt Toolkit. |
170 | @@ -50,6 +50,7 @@ | |||
171 | 50 | #include "qmirclientnativeinterface.h" | 50 | #include "qmirclientnativeinterface.h" |
172 | 51 | #include "qmirclientscreen.h" | 51 | #include "qmirclientscreen.h" |
173 | 52 | #include "qmirclientwindow.h" | 52 | #include "qmirclientwindow.h" |
174 | 53 | #include "../shared/ubuntutheme.h" | ||
175 | 53 | 54 | ||
176 | 54 | // Qt | 55 | // Qt |
177 | 55 | #include <QFileInfo> | 56 | #include <QFileInfo> |
178 | @@ -61,7 +62,6 @@ | |||
179 | 61 | #include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h> | 62 | #include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h> |
180 | 62 | #include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h> | 63 | #include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h> |
181 | 63 | #include <QtPlatformSupport/private/qeglpbuffer_p.h> | 64 | #include <QtPlatformSupport/private/qeglpbuffer_p.h> |
182 | 64 | #include <QtPlatformSupport/private/qgenericunixthemes_p.h> | ||
183 | 65 | #include <QtPlatformSupport/private/bridge_p.h> | 65 | #include <QtPlatformSupport/private/bridge_p.h> |
184 | 66 | #include <QOpenGLContext> | 66 | #include <QOpenGLContext> |
185 | 67 | #include <QOffscreenSurface> | 67 | #include <QOffscreenSurface> |
186 | @@ -71,27 +71,6 @@ | |||
187 | 71 | #include <ubuntu/application/id.h> | 71 | #include <ubuntu/application/id.h> |
188 | 72 | #include <ubuntu/application/options.h> | 72 | #include <ubuntu/application/options.h> |
189 | 73 | 73 | ||
190 | 74 | |||
191 | 75 | class UbuntuIconTheme : public QGenericUnixTheme | ||
192 | 76 | { | ||
193 | 77 | public: | ||
194 | 78 | UbuntuIconTheme() {} | ||
195 | 79 | |||
196 | 80 | // From QPlatformTheme | ||
197 | 81 | QVariant themeHint(ThemeHint hint) const override { | ||
198 | 82 | if (hint == QPlatformTheme::SystemIconThemeName) { | ||
199 | 83 | QByteArray iconTheme = qgetenv("QTUBUNTU_ICON_THEME"); | ||
200 | 84 | if (iconTheme.isEmpty()) { | ||
201 | 85 | return QVariant(QStringLiteral("ubuntu-mobile")); | ||
202 | 86 | } else { | ||
203 | 87 | return QVariant(QString(iconTheme)); | ||
204 | 88 | } | ||
205 | 89 | } else { | ||
206 | 90 | return QGenericUnixTheme::themeHint(hint); | ||
207 | 91 | } | ||
208 | 92 | } | ||
209 | 93 | }; | ||
210 | 94 | |||
211 | 95 | static void resumedCallback(const UApplicationOptions */*options*/, void *context) | 74 | static void resumedCallback(const UApplicationOptions */*options*/, void *context) |
212 | 96 | { | 75 | { |
213 | 97 | auto integration = static_cast<QMirClientClientIntegration*>(context); | 76 | auto integration = static_cast<QMirClientClientIntegration*>(context); |
214 | @@ -351,7 +330,7 @@ | |||
215 | 351 | QPlatformTheme* QMirClientClientIntegration::createPlatformTheme(const QString& name) const | 330 | QPlatformTheme* QMirClientClientIntegration::createPlatformTheme(const QString& name) const |
216 | 352 | { | 331 | { |
217 | 353 | Q_UNUSED(name); | 332 | Q_UNUSED(name); |
219 | 354 | return new UbuntuIconTheme; | 333 | return new UbuntuTheme; |
220 | 355 | } | 334 | } |
221 | 356 | 335 | ||
222 | 357 | QVariant QMirClientClientIntegration::styleHint(StyleHint hint) const | 336 | QVariant QMirClientClientIntegration::styleHint(StyleHint hint) const |
223 | 358 | 337 | ||
224 | === modified file 'src/ubuntumirclient/ubuntumirclient.pro' | |||
225 | --- src/ubuntumirclient/ubuntumirclient.pro 2017-02-07 15:37:20 +0000 | |||
226 | +++ src/ubuntumirclient/ubuntumirclient.pro 2017-03-29 14:17:03 +0000 | |||
227 | @@ -48,7 +48,8 @@ | |||
228 | 48 | qmirclientscreen.h \ | 48 | qmirclientscreen.h \ |
229 | 49 | qmirclientwindow.h \ | 49 | qmirclientwindow.h \ |
230 | 50 | qmirclientlogging.h \ | 50 | qmirclientlogging.h \ |
232 | 51 | qmirclientappstatecontroller.h | 51 | qmirclientappstatecontroller.h \ |
233 | 52 | ../shared/ubuntutheme.h | ||
234 | 52 | 53 | ||
235 | 53 | OTHER_FILES += \ | 54 | OTHER_FILES += \ |
236 | 54 | ubuntumirclient.json | 55 | ubuntumirclient.json |
PASSED: Continuous integration, rev:385 /unity8- jenkins. ubuntu. com/job/ lp-qtubuntu- ci/216/ /unity8- jenkins. ubuntu. com/job/ build/4733 /unity8- jenkins. ubuntu. com/job/ build-0- fetch/4761 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 4584 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 4584/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= zesty/4584 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= zesty/4584/ artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 4584 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 4584/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= zesty/4584 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= zesty/4584/ artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 4584 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 4584/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= zesty/4584 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= zesty/4584/ artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-qtubuntu- ci/216/ rebuild
https:/