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
1=== modified file 'data/external_icon_orange.png'
2Binary 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
3=== modified file 'data/external_icon_white.png'
4Binary 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
5=== modified file 'data/qt/controlpanel.ui'
6--- data/qt/controlpanel.ui 2012-03-19 15:50:31 +0000
7+++ data/qt/controlpanel.ui 2012-03-20 13:12:17 +0000
8@@ -287,6 +287,9 @@
9 <property name="text">
10 <string notr="true">Get help online</string>
11 </property>
12+ <property name="flat">
13+ <bool>true</bool>
14+ </property>
15 </widget>
16 </item>
17 <item>
18@@ -330,6 +333,9 @@
19 <iconset resource="images.qrc">
20 <normaloff>:/twitter.png</normaloff>:/twitter.png</iconset>
21 </property>
22+ <property name="flat">
23+ <bool>true</bool>
24+ </property>
25 </widget>
26 </item>
27 <item>
28@@ -353,6 +359,9 @@
29 <iconset resource="images.qrc">
30 <normaloff>:/facebook.png</normaloff>:/facebook.png</iconset>
31 </property>
32+ <property name="flat">
33+ <bool>true</bool>
34+ </property>
35 </widget>
36 </item>
37 </layout>
38
39=== modified file 'data/qt/folders.ui'
40--- data/qt/folders.ui 2012-03-16 18:54:55 +0000
41+++ data/qt/folders.ui 2012-03-20 13:12:17 +0000
42@@ -35,7 +35,7 @@
43 <item>
44 <widget class="GoToWebButton" name="share_publish_button">
45 <property name="sizePolicy">
46- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
47+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
48 <horstretch>0</horstretch>
49 <verstretch>0</verstretch>
50 </sizepolicy>
51@@ -43,6 +43,9 @@
52 <property name="text">
53 <string notr="true">Go to the web for public and private sharing options</string>
54 </property>
55+ <property name="flat">
56+ <bool>true</bool>
57+ </property>
58 </widget>
59 </item>
60 <item>
61
62=== modified file 'data/qt/ubuntuone.qss'
63--- data/qt/ubuntuone.qss 2012-03-15 01:25:08 +0000
64+++ data/qt/ubuntuone.qss 2012-03-20 13:12:17 +0000
65@@ -86,8 +86,8 @@
66 padding-left: 19px;
67 padding-right: 19px;
68 /* hack to make the mild-orange focused box dissapear */
69- padding-top: 20px;
70- padding-bottom: 20px;
71+ padding-top: 100%;
72+ padding-bottom: 100%;
73 /* end of hack */
74 }
75
76@@ -157,6 +157,7 @@
77 QPushButton#twitter_button,
78 QPushButton#facebook_button {
79 background: transparent;
80+ border: none;
81 }
82
83 QPushButton#twitter_button:focus,
84@@ -165,30 +166,51 @@
85 }
86
87 GoToWebButton#help_button {
88- padding: 2px;
89-}
90-
91-GoToWebButton#share_publish_button,
92-GoToWebButton#help_button {
93 background: transparent;
94 border: none;
95 text-decoration: underline;
96+ color: white;
97+ padding-left: 10px;
98+ padding-right: 25px;
99+ background-image: url(:/external_icon_white.png);
100+ background-repeat: no-repeat;
101+ background-position: right;
102+ background-origin: margin;
103+}
104+
105+GoToWebButton#help_button:focus {
106+ border: 2px solid #dd4814;
107+ /* hack to make the mild-orange focused box dissapear */
108+ padding-top: 100%;
109+ padding-bottom: 100%;
110+ /* end of hack */
111+ /* Compensate for border so text doesn't move */
112+ padding-left: 8px;
113+ padding-right: 23px;
114 }
115
116 GoToWebButton#share_publish_button {
117+ background: transparent;
118+ border: none;
119+ text-decoration: underline;
120 color: #dd4814;
121-}
122-
123-GoToWebButton#help_button {
124- color: white;
125+ padding-left: 10px;
126+ padding-right: 25px;
127+ background-image: url(:/external_icon_orange.png);
128+ background-repeat: no-repeat;
129+ background-position: right;
130+ background-origin: margin;
131 }
132
133 GoToWebButton#share_publish_button:focus {
134 border: 2px solid #aea79f;
135-}
136-
137-GoToWebButton#help_button:focus {
138- border: 2px solid #dd4814;
139+ /* hack to make the mild-orange focused box dissapear */
140+ padding-top: 100%;
141+ padding-bottom: 100%;
142+ /* end of hack */
143+ /* Compensate for border so text doesn't move */
144+ padding-left: 8px;
145+ padding-right: 23px;
146 }
147
148 QTabBar::tab {
149@@ -288,6 +310,9 @@
150 QListWidget#list_devices::item {
151 min-height: 48px;
152 }
153+QListWidget#list_devices::item:selected {
154+ background: #fcece7;
155+}
156
157 QGroupBox#local_device_box,
158 QListWidget#list_devices::item {
159@@ -325,7 +350,42 @@
160 background: #efedec;
161 }
162
163+QCheckBox {
164+ padding-left: 2px;
165+ padding-right: 2px;
166+}
167+
168 QCheckBox:focus {
169 border-radius: 5px;
170 border: 2px solid #dd4814;
171+ /* Compensate for border */
172+ padding-left: 0px;
173+ padding-right: 0px;
174+}
175+
176+GoToWebButton#edit_profile_button,
177+GoToWebButton#edit_services_button,
178+GoToWebButton#get_more_space_button {
179+ padding-left: 8px;
180+ padding-right: 25px;
181+ background-image: url(:/external_icon_white.png);
182+ background-repeat: no-repeat;
183+ background-position: right;
184+ background-origin: margin;
185+}
186+
187+QSpinBox {
188+ padding: 3px;
189+}
190+
191+QSpinBox:focus {
192+ border: 2px solid #dd4814;
193+ border-radius: 5px;
194+ padding: 0px;
195+}
196+
197+
198+QTreeWidget::item:selected {
199+ background: #fcece7;
200+ color: black;
201 }
202
203=== modified file 'ubuntuone/controlpanel/gui/qt/folders.py'
204--- ubuntuone/controlpanel/gui/qt/folders.py 2012-03-19 20:55:52 +0000
205+++ ubuntuone/controlpanel/gui/qt/folders.py 2012-03-20 13:12:17 +0000
206@@ -133,8 +133,6 @@
207
208 self.ui.share_publish_button.setText(FOLDERS_MANAGE_LABEL)
209 self.ui.share_publish_button.uri = MANAGE_FILES_LINK
210- icon = icon_from_name('external_icon_orange')
211- self.ui.share_publish_button.setIcon(icon)
212 QtGui.QApplication.instance().focusChanged.connect(self.focus_changed)
213
214 def focus_changed(self, old, new):
215@@ -226,6 +224,7 @@
216 # item's checkState, because of focus and navigation
217 # issues.
218 checkbox = QtGui.QCheckBox(parent=self.ui.folders)
219+ checkbox.setMaximumWidth(24)
220 self.widget_items[checkbox] = child
221 if subscribed:
222 checkbox.setCheckState(CHECKED)
223
224=== modified file 'ubuntuone/controlpanel/gui/qt/gotoweb.py'
225--- ubuntuone/controlpanel/gui/qt/gotoweb.py 2012-03-19 15:50:31 +0000
226+++ ubuntuone/controlpanel/gui/qt/gotoweb.py 2012-03-20 13:12:17 +0000
227@@ -42,8 +42,6 @@
228 if self.legend is not None:
229 self.setText(self.legend)
230
231- self.setIcon(qt.icon_from_name('external_icon_white'))
232- self.setLayoutDirection(QtCore.Qt.RightToLeft)
233 self.clicked.connect(self.on_clicked)
234 self.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
235
236
237=== modified file 'ubuntuone/controlpanel/gui/qt/tests/test_gotoweb.py'
238--- ubuntuone/controlpanel/gui/qt/tests/test_gotoweb.py 2012-03-19 20:55:52 +0000
239+++ ubuntuone/controlpanel/gui/qt/tests/test_gotoweb.py 2012-03-20 13:12:17 +0000
240@@ -47,10 +47,6 @@
241 self.ui.uri = uri
242 self.assertEqual(self.ui.uri, uri)
243
244- def test_layout_direction(self):
245- """The layout direction is RightToLeft."""
246- self.assertEqual(self.ui.layoutDirection(), gui.QtCore.Qt.RightToLeft)
247-
248 def test_cursor_pointer(self):
249 """The cursor is PointingHandCursor."""
250 self.assertEqual(self.ui.cursor().shape(),

Subscribers

People subscribed via source and target branches