Merge lp:~ralsina/ubuntuone-control-panel/ubuntu-font-in-windows into lp:ubuntuone-control-panel

Proposed by Roberto Alsina on 2012-03-15
Status: Merged
Approved by: Roberto Alsina on 2012-03-16
Approved revision: 293
Merged at revision: 288
Proposed branch: lp:~ralsina/ubuntuone-control-panel/ubuntu-font-in-windows
Merge into: lp:ubuntuone-control-panel
Prerequisite: lp:~dobey/ubuntuone-control-panel/system-font
Diff against target: 100 lines (+25/-6)
8 files modified
data/qt/images.qrc (+2/-0)
data/qt/linux.qss (+2/-0)
data/qt/ubuntuone.qss (+0/-1)
data/qt/windows.qss (+5/-0)
ubuntuone/controlpanel/gui/qt/main/__init__.py (+5/-2)
ubuntuone/controlpanel/gui/qt/main/linux.py (+2/-0)
ubuntuone/controlpanel/gui/qt/main/tests/test_main.py (+7/-3)
ubuntuone/controlpanel/gui/qt/main/windows.py (+2/-0)
To merge this branch: bzr merge lp:~ralsina/ubuntuone-control-panel/ubuntu-font-in-windows
Reviewer Review Type Date Requested Status
Eric Casteleijn (community) Approve on 2012-03-16
dobey (community) 2012-03-15 Approve on 2012-03-15
Review via email: mp+97554@code.launchpad.net

Commit Message

- Enable platform-specific styling (LP: #953318).

Description of the Change

Load a composite stylesheet from a main file and a platform-specific one.

To test IRL: on ubuntu, you should not get the ubuntu font anymore. On windows, you should get the ubuntu font.

To post a comment you must log in.
dobey (dobey) :
review: Approve
290. By Roberto Alsina on 2012-03-15

updated system-font branch

291. By Roberto Alsina on 2012-03-16

trunk merged, conflicts resolved

292. By Roberto Alsina on 2012-03-16

newline at EOF

293. By Roberto Alsina on 2012-03-16

fix test

Eric Casteleijn (thisfred) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/qt/images.qrc'
2--- data/qt/images.qrc 2012-03-02 13:53:24 +0000
3+++ data/qt/images.qrc 2012-03-16 21:18:20 +0000
4@@ -23,5 +23,7 @@
5 <file>../Ubuntu-R.ttf</file>
6 <file>../Ubuntu-B.ttf</file>
7 <file>ubuntuone.qss</file>
8+ <file>linux.qss</file>
9+ <file>windows.qss</file>
10 </qresource>
11 </RCC>
12
13=== added file 'data/qt/linux.qss'
14--- data/qt/linux.qss 1970-01-01 00:00:00 +0000
15+++ data/qt/linux.qss 2012-03-16 21:18:20 +0000
16@@ -0,0 +1,2 @@
17+/* Styles specific to the linux platform */
18+
19
20=== modified file 'data/qt/ubuntuone.qss'
21--- data/qt/ubuntuone.qss 2012-03-12 20:29:41 +0000
22+++ data/qt/ubuntuone.qss 2012-03-16 21:18:20 +0000
23@@ -11,7 +11,6 @@
24 }
25
26 QWidget {
27- font-family: "Ubuntu";
28 color: #333333;
29 }
30
31
32=== added file 'data/qt/windows.qss'
33--- data/qt/windows.qss 1970-01-01 00:00:00 +0000
34+++ data/qt/windows.qss 2012-03-16 21:18:20 +0000
35@@ -0,0 +1,5 @@
36+/* Styles specific to the windows platform */
37+
38+QWidget {
39+ font-family: "Ubuntu";
40+}
41
42=== modified file 'ubuntuone/controlpanel/gui/qt/main/__init__.py'
43--- ubuntuone/controlpanel/gui/qt/main/__init__.py 2012-03-15 16:42:21 +0000
44+++ ubuntuone/controlpanel/gui/qt/main/__init__.py 2012-03-16 21:18:20 +0000
45@@ -84,8 +84,11 @@
46 with_icon = args.with_icon
47 source.main(app)
48
49- qss = QtCore.QResource(":/ubuntuone.qss")
50- app.setStyleSheet(qss.data())
51+ data = []
52+ for qss_name in (source.PLATFORM_QSS, ":/ubuntuone.qss"):
53+ qss = QtCore.QResource(qss_name)
54+ data.append(unicode(qss.data()))
55+ app.setStyleSheet('\n'.join(data))
56
57 # Unused variable 'window', 'icon', pylint: disable=W0612
58 icon, window = start(lambda: source.main_quit(app),
59
60=== modified file 'ubuntuone/controlpanel/gui/qt/main/linux.py'
61--- ubuntuone/controlpanel/gui/qt/main/linux.py 2012-02-06 21:10:10 +0000
62+++ ubuntuone/controlpanel/gui/qt/main/linux.py 2012-03-16 21:18:20 +0000
63@@ -31,3 +31,5 @@
64 def main_quit(app):
65 """Stop the mainloop."""
66 app.exit()
67+
68+PLATFORM_QSS = ":/linux.qss"
69
70=== modified file 'ubuntuone/controlpanel/gui/qt/main/tests/test_main.py'
71--- ubuntuone/controlpanel/gui/qt/main/tests/test_main.py 2012-03-15 17:05:45 +0000
72+++ ubuntuone/controlpanel/gui/qt/main/tests/test_main.py 2012-03-16 21:18:20 +0000
73@@ -146,10 +146,14 @@
74 self.assertEqual(self.start.args[1],
75 {'minimized': False, 'with_icon': True})
76
77- def test_style_loads(self):
78- """Ensure the stylesheet is loaded."""
79+ def test_all_styles_load(self):
80+ """Ensure the platform style is loaded."""
81 main.main([sys.argv[0]])
82- self.assertTrue(self.app.style)
83+ data = []
84+ for qss_name in (main.source.PLATFORM_QSS, ":/ubuntuone.qss"):
85+ qss = QtCore.QResource(qss_name)
86+ data.append(unicode(qss.data()))
87+ self.assertEqual((('\n'.join(data),), {}), self.app.style)
88
89 def test_switch_to_option(self):
90 """Ensure the --switch-to option is parsed and passed correctly."""
91
92=== modified file 'ubuntuone/controlpanel/gui/qt/main/windows.py'
93--- ubuntuone/controlpanel/gui/qt/main/windows.py 2012-02-28 14:49:21 +0000
94+++ ubuntuone/controlpanel/gui/qt/main/windows.py 2012-03-16 21:18:20 +0000
95@@ -42,3 +42,5 @@
96
97
98 # pylint: enable=E1101
99+
100+PLATFORM_QSS = ":/windows.qss"

Subscribers

People subscribed via source and target branches