Merge lp:~ralsina/ubuntuone-control-panel/tweaks into lp:ubuntuone-control-panel

Proposed by Roberto Alsina
Status: Merged
Approved by: Natalia Bidart
Approved revision: 296
Merged at revision: 291
Proposed branch: lp:~ralsina/ubuntuone-control-panel/tweaks
Merge into: lp:ubuntuone-control-panel
Diff against target: 250 lines (+89/-24)
6 files modified
data/qt/controlpanel.ui (+9/-0)
data/qt/folders.ui (+4/-1)
data/qt/ubuntuone.qss (+75/-15)
ubuntuone/controlpanel/gui/qt/folders.py (+1/-2)
ubuntuone/controlpanel/gui/qt/gotoweb.py (+0/-2)
ubuntuone/controlpanel/gui/qt/tests/test_gotoweb.py (+0/-4)
To merge this branch: bzr merge lp:~ralsina/ubuntuone-control-panel/tweaks
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
dobey (community) Approve
Eric Casteleijn (community) Approve
Review via email: mp+97244@code.launchpad.net

Commit message

- Added several tweaks to the UI stylesheet to avoid 'movements' when focusing a button, and to remove the ugly border from the twitter and facebook buttons.

Description of the change

Here are the changes with before/after images

* Remove borders from non-focused twitter/facebook buttons

Before: http://ubuntuone.com/0GlwHiflybykoUHZHZ8Gqw
After: http://ubuntuone.com/26uaOMSFZyxU0eiR4axh7T

* Change in the no-orange-overlay hack from 20px to 100%

No visible change except on rare occasions where 20px made pieces of text hide

* Do the GotoWebButtons arrows using qss and not setIcon
* Make the GotoWebButtons not shift when focused

Before, the text and icon shifted when you focused the button.
Now, they don't. The padding is different, and is not consistent
between buttons so it needs tweaking, if we go this way.

Before/after: http://ubuntuone.com/60XK8tDRjGP6AkZtH3bArf

* Changed background color on folder list activated item

Before, you could not see focus halos on buttons and checkboxes because of color clash:

http://ubuntuone.com/75Btee7WZ52WgQCYWJtdV4

After:

http://ubuntuone.com/4UKzBrcunwQteDz53YVPJp

* Focus halo on QCheckboxes

Before: the checkbox contents shifted when focused
http://ubuntuone.com/4uVKYiXzISNvTNr7WOv0Sk

Now: no shifting

http://ubuntuone.com/0gT5oilxtJi9m5Ca7VoLTx

* Style fix for focused Checkbox in folder list

Before:
http://ubuntuone.com/0quTUFP95oeI0z8O53w487

After: Not terribly happy about it, really.
http://ubuntuone.com/5G1o70sxMv0moaUVjZhFNX

* Focus halo on QSpinBox

Before: http://ubuntuone.com/1GHBE7Les5VpMweDbnjfEi
After: http://ubuntuone.com/6zzB7ohnZpaHihuPVlLT0e

To post a comment you must log in.
292. By Roberto Alsina

useless change

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/nessita/canonical/controlpanel/review_tweaks/ubuntuone/controlpanel/gui/qt/tests/test_gotoweb.py", line 47, in test_layout_direction
    self.assertEqual(self.ui.layoutDirection(), gui.QtCore.Qt.RightToLeft)
  File "/usr/lib/python2.7/dist-packages/twisted/trial/unittest.py", line 270, in assertEqual
    % (msg, pformat(first), pformat(second)))
twisted.trial.unittest.FailTest: not equal:
a = 0
b = 1

ubuntuone.controlpanel.gui.qt.tests.test_gotoweb.GoToWebButtonTestCase.test_layout_direction
-------------------------------------------------------------------------------
Ran 861 tests in 7.354s

FAILED (skips=2, failures=1, successes=858)

review: Needs Fixing
293. By Roberto Alsina

test is no longer appropiate

Revision history for this message
Eric Casteleijn (thisfred) wrote :

Works for me

review: Approve
Revision history for this message
Roberto Alsina (ralsina) wrote :

oops, forgot to remove that test. Fixed now.

Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Question:

(09:39:18 AM) nessita: ralsina: having this:
(09:39:18 AM) nessita: /* Compensate for border so text doesn't move */
(09:39:18 AM) nessita: padding-left: 8px;
(09:39:18 AM) nessita: padding-right: 23px;
(09:39:18 AM) nessita: isn't that absolutely dependent of the font size? (ie how many pixels are needed so text do not move)

Need fixing:

* This is a screenshot of trunk, for the devices tab, when tabbing into the devices list you can tell which device is focused: http://ubuntuone.com/4dkwoumzqmtChYd6aZjkGy

* This is the same screenshot from this branch, and I can not tell which device is focused: http://ubuntuone.com/759m76t6EOb5sUYyHrgtrn

review: Needs Fixing
294. By Roberto Alsina

merged trunk

Revision history for this message
Roberto Alsina (ralsina) wrote :

restored the dotted highlight on the focused device list.

295. By Roberto Alsina

restore dotted box around devices

Revision history for this message
Roberto Alsina (ralsina) wrote :

> Question:
>
> (09:39:18 AM) nessita: ralsina: having this:
> (09:39:18 AM) nessita: /* Compensate for border so text doesn't move */
> (09:39:18 AM) nessita: padding-left: 8px;
> (09:39:18 AM) nessita: padding-right: 23px;
> (09:39:18 AM) nessita: isn't that absolutely dependent of the font size? (ie
> how many pixels are needed so text do not move)

No, it's dependent on border size, it only has to be 2px smaller on each direction than the unfocused state.

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Could you please fix:
Text conflict in ubuntuone/controlpanel/gui/qt/gotoweb.py
1 conflicts encountered.

296. By Roberto Alsina

merged trunk, resolved conflict

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/external_icon_orange.png'
0Binary files data/external_icon_orange.png 2011-07-10 21:35:02 +0000 and data/external_icon_orange.png 2012-03-20 13:12:17 +0000 differ0Binary files data/external_icon_orange.png 2011-07-10 21:35:02 +0000 and data/external_icon_orange.png 2012-03-20 13:12:17 +0000 differ
=== modified file 'data/external_icon_white.png'
1Binary files data/external_icon_white.png 2011-07-10 21:35:02 +0000 and data/external_icon_white.png 2012-03-20 13:12:17 +0000 differ1Binary files data/external_icon_white.png 2011-07-10 21:35:02 +0000 and data/external_icon_white.png 2012-03-20 13:12:17 +0000 differ
=== modified file 'data/qt/controlpanel.ui'
--- data/qt/controlpanel.ui 2012-03-19 15:50:31 +0000
+++ data/qt/controlpanel.ui 2012-03-20 13:12:17 +0000
@@ -287,6 +287,9 @@
287 <property name="text">287 <property name="text">
288 <string notr="true">Get help online</string>288 <string notr="true">Get help online</string>
289 </property>289 </property>
290 <property name="flat">
291 <bool>true</bool>
292 </property>
290 </widget>293 </widget>
291 </item>294 </item>
292 <item>295 <item>
@@ -330,6 +333,9 @@
330 <iconset resource="images.qrc">333 <iconset resource="images.qrc">
331 <normaloff>:/twitter.png</normaloff>:/twitter.png</iconset>334 <normaloff>:/twitter.png</normaloff>:/twitter.png</iconset>
332 </property>335 </property>
336 <property name="flat">
337 <bool>true</bool>
338 </property>
333 </widget>339 </widget>
334 </item>340 </item>
335 <item>341 <item>
@@ -353,6 +359,9 @@
353 <iconset resource="images.qrc">359 <iconset resource="images.qrc">
354 <normaloff>:/facebook.png</normaloff>:/facebook.png</iconset>360 <normaloff>:/facebook.png</normaloff>:/facebook.png</iconset>
355 </property>361 </property>
362 <property name="flat">
363 <bool>true</bool>
364 </property>
356 </widget>365 </widget>
357 </item>366 </item>
358 </layout>367 </layout>
359368
=== modified file 'data/qt/folders.ui'
--- data/qt/folders.ui 2012-03-16 18:54:55 +0000
+++ data/qt/folders.ui 2012-03-20 13:12:17 +0000
@@ -35,7 +35,7 @@
35 <item>35 <item>
36 <widget class="GoToWebButton" name="share_publish_button">36 <widget class="GoToWebButton" name="share_publish_button">
37 <property name="sizePolicy">37 <property name="sizePolicy">
38 <sizepolicy hsizetype="Preferred" vsizetype="Fixed">38 <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
39 <horstretch>0</horstretch>39 <horstretch>0</horstretch>
40 <verstretch>0</verstretch>40 <verstretch>0</verstretch>
41 </sizepolicy>41 </sizepolicy>
@@ -43,6 +43,9 @@
43 <property name="text">43 <property name="text">
44 <string notr="true">Go to the web for public and private sharing options</string>44 <string notr="true">Go to the web for public and private sharing options</string>
45 </property>45 </property>
46 <property name="flat">
47 <bool>true</bool>
48 </property>
46 </widget>49 </widget>
47 </item>50 </item>
48 <item>51 <item>
4952
=== modified file 'data/qt/ubuntuone.qss'
--- data/qt/ubuntuone.qss 2012-03-15 01:25:08 +0000
+++ data/qt/ubuntuone.qss 2012-03-20 13:12:17 +0000
@@ -86,8 +86,8 @@
86 padding-left: 19px;86 padding-left: 19px;
87 padding-right: 19px;87 padding-right: 19px;
88 /* hack to make the mild-orange focused box dissapear */88 /* hack to make the mild-orange focused box dissapear */
89 padding-top: 20px;89 padding-top: 100%;
90 padding-bottom: 20px;90 padding-bottom: 100%;
91 /* end of hack */91 /* end of hack */
92}92}
9393
@@ -157,6 +157,7 @@
157QPushButton#twitter_button,157QPushButton#twitter_button,
158QPushButton#facebook_button {158QPushButton#facebook_button {
159 background: transparent;159 background: transparent;
160 border: none;
160}161}
161162
162QPushButton#twitter_button:focus,163QPushButton#twitter_button:focus,
@@ -165,30 +166,51 @@
165}166}
166167
167GoToWebButton#help_button {168GoToWebButton#help_button {
168 padding: 2px;
169}
170
171GoToWebButton#share_publish_button,
172GoToWebButton#help_button {
173 background: transparent;169 background: transparent;
174 border: none;170 border: none;
175 text-decoration: underline;171 text-decoration: underline;
172 color: white;
173 padding-left: 10px;
174 padding-right: 25px;
175 background-image: url(:/external_icon_white.png);
176 background-repeat: no-repeat;
177 background-position: right;
178 background-origin: margin;
179}
180
181GoToWebButton#help_button:focus {
182 border: 2px solid #dd4814;
183 /* hack to make the mild-orange focused box dissapear */
184 padding-top: 100%;
185 padding-bottom: 100%;
186 /* end of hack */
187 /* Compensate for border so text doesn't move */
188 padding-left: 8px;
189 padding-right: 23px;
176}190}
177191
178GoToWebButton#share_publish_button {192GoToWebButton#share_publish_button {
193 background: transparent;
194 border: none;
195 text-decoration: underline;
179 color: #dd4814;196 color: #dd4814;
180}197 padding-left: 10px;
181198 padding-right: 25px;
182GoToWebButton#help_button {199 background-image: url(:/external_icon_orange.png);
183 color: white;200 background-repeat: no-repeat;
201 background-position: right;
202 background-origin: margin;
184}203}
185204
186GoToWebButton#share_publish_button:focus {205GoToWebButton#share_publish_button:focus {
187 border: 2px solid #aea79f;206 border: 2px solid #aea79f;
188}207 /* hack to make the mild-orange focused box dissapear */
189208 padding-top: 100%;
190GoToWebButton#help_button:focus {209 padding-bottom: 100%;
191 border: 2px solid #dd4814;210 /* end of hack */
211 /* Compensate for border so text doesn't move */
212 padding-left: 8px;
213 padding-right: 23px;
192}214}
193215
194QTabBar::tab {216QTabBar::tab {
@@ -288,6 +310,9 @@
288QListWidget#list_devices::item {310QListWidget#list_devices::item {
289 min-height: 48px;311 min-height: 48px;
290}312}
313QListWidget#list_devices::item:selected {
314 background: #fcece7;
315}
291316
292QGroupBox#local_device_box,317QGroupBox#local_device_box,
293QListWidget#list_devices::item {318QListWidget#list_devices::item {
@@ -325,7 +350,42 @@
325 background: #efedec;350 background: #efedec;
326}351}
327352
353QCheckBox {
354 padding-left: 2px;
355 padding-right: 2px;
356}
357
328QCheckBox:focus {358QCheckBox:focus {
329 border-radius: 5px;359 border-radius: 5px;
330 border: 2px solid #dd4814;360 border: 2px solid #dd4814;
361 /* Compensate for border */
362 padding-left: 0px;
363 padding-right: 0px;
364}
365
366GoToWebButton#edit_profile_button,
367GoToWebButton#edit_services_button,
368GoToWebButton#get_more_space_button {
369 padding-left: 8px;
370 padding-right: 25px;
371 background-image: url(:/external_icon_white.png);
372 background-repeat: no-repeat;
373 background-position: right;
374 background-origin: margin;
375}
376
377QSpinBox {
378 padding: 3px;
379}
380
381QSpinBox:focus {
382 border: 2px solid #dd4814;
383 border-radius: 5px;
384 padding: 0px;
385}
386
387
388QTreeWidget::item:selected {
389 background: #fcece7;
390 color: black;
331}391}
332392
=== modified file 'ubuntuone/controlpanel/gui/qt/folders.py'
--- ubuntuone/controlpanel/gui/qt/folders.py 2012-03-19 20:55:52 +0000
+++ ubuntuone/controlpanel/gui/qt/folders.py 2012-03-20 13:12:17 +0000
@@ -133,8 +133,6 @@
133133
134 self.ui.share_publish_button.setText(FOLDERS_MANAGE_LABEL)134 self.ui.share_publish_button.setText(FOLDERS_MANAGE_LABEL)
135 self.ui.share_publish_button.uri = MANAGE_FILES_LINK135 self.ui.share_publish_button.uri = MANAGE_FILES_LINK
136 icon = icon_from_name('external_icon_orange')
137 self.ui.share_publish_button.setIcon(icon)
138 QtGui.QApplication.instance().focusChanged.connect(self.focus_changed)136 QtGui.QApplication.instance().focusChanged.connect(self.focus_changed)
139137
140 def focus_changed(self, old, new):138 def focus_changed(self, old, new):
@@ -226,6 +224,7 @@
226 # item's checkState, because of focus and navigation224 # item's checkState, because of focus and navigation
227 # issues.225 # issues.
228 checkbox = QtGui.QCheckBox(parent=self.ui.folders)226 checkbox = QtGui.QCheckBox(parent=self.ui.folders)
227 checkbox.setMaximumWidth(24)
229 self.widget_items[checkbox] = child228 self.widget_items[checkbox] = child
230 if subscribed:229 if subscribed:
231 checkbox.setCheckState(CHECKED)230 checkbox.setCheckState(CHECKED)
232231
=== modified file 'ubuntuone/controlpanel/gui/qt/gotoweb.py'
--- ubuntuone/controlpanel/gui/qt/gotoweb.py 2012-03-19 15:50:31 +0000
+++ ubuntuone/controlpanel/gui/qt/gotoweb.py 2012-03-20 13:12:17 +0000
@@ -42,8 +42,6 @@
42 if self.legend is not None:42 if self.legend is not None:
43 self.setText(self.legend)43 self.setText(self.legend)
4444
45 self.setIcon(qt.icon_from_name('external_icon_white'))
46 self.setLayoutDirection(QtCore.Qt.RightToLeft)
47 self.clicked.connect(self.on_clicked)45 self.clicked.connect(self.on_clicked)
48 self.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))46 self.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
4947
5048
=== modified file 'ubuntuone/controlpanel/gui/qt/tests/test_gotoweb.py'
--- ubuntuone/controlpanel/gui/qt/tests/test_gotoweb.py 2012-03-19 20:55:52 +0000
+++ ubuntuone/controlpanel/gui/qt/tests/test_gotoweb.py 2012-03-20 13:12:17 +0000
@@ -47,10 +47,6 @@
47 self.ui.uri = uri47 self.ui.uri = uri
48 self.assertEqual(self.ui.uri, uri)48 self.assertEqual(self.ui.uri, uri)
4949
50 def test_layout_direction(self):
51 """The layout direction is RightToLeft."""
52 self.assertEqual(self.ui.layoutDirection(), gui.QtCore.Qt.RightToLeft)
53
54 def test_cursor_pointer(self):50 def test_cursor_pointer(self):
55 """The cursor is PointingHandCursor."""51 """The cursor is PointingHandCursor."""
56 self.assertEqual(self.ui.cursor().shape(),52 self.assertEqual(self.ui.cursor().shape(),

Subscribers

People subscribed via source and target branches