Merge lp:~woodrow-shen/unity-greeter/fix-hidpi-support into lp:unity-greeter
- fix-hidpi-support
- Merge into trunk
Status: | Rejected |
---|---|
Rejected by: | Robert Ancell |
Proposed branch: | lp:~woodrow-shen/unity-greeter/fix-hidpi-support |
Merge into: | lp:unity-greeter |
Diff against target: |
617 lines (+171/-38) (has conflicts) 13 files modified
NEWS (+8/-0) configure.ac (+4/-0) debian/changelog (+11/-0) src/cairo-utils.vala (+27/-0) src/dash-box.vala (+8/-4) src/dash-button.vala (+3/-1) src/dash-entry.vala (+8/-3) src/greeter-list.vala (+13/-8) src/list-stack.vala (+2/-1) src/main-window.vala (+4/-1) src/menubar.vala (+14/-2) src/prompt-box.vala (+26/-9) src/shutdown-dialog.vala (+43/-9) Text conflict in NEWS Text conflict in configure.ac Text conflict in debian/changelog |
To merge this branch: | bzr merge lp:~woodrow-shen/unity-greeter/fix-hidpi-support |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Ancell | Pending | ||
Review via email: mp+242046@code.launchpad.net |
Commit message
This patch try to fix the problem that unity-greeter can't scale on a hidpi display.
Currenly the icons on menubar still don't work, and sometimes menuitem may unchanged
unexpectedly.
Description of the change
The fix can scale menubar, prompt-box, and shutdown-dialog box according to gnome hidpi rules from https:/
Robert Ancell (robert-ancell) wrote : | # |
Robert Ancell (robert-ancell) wrote : | # |
In check_hidpi_display you iterate across all the monitors but only check the primary one. Why not just:
screen.
Robert Ancell (robert-ancell) wrote : | # |
You have a number of cases where you've used an explicit variable type, e.g. "int num_monitor" where you could just use "var num_monitor" instead.
Robert Ancell (robert-ancell) wrote : | # |
You have a lot of hardcoded scaling like:
var hidpi = CairoUtils.
scale = (hidpi) ? 2 : 1;
Why not:
scale = CairoUtils.
and just define the 2 once in that function?
Robert Ancell (robert-ancell) wrote : | # |
It otherwise looks pretty good. Thanks Woodrow!
Woodrow Shen (woodrow-shen) wrote : | # |
ok, I will re-modify it and re-send proposal to lp:unity-greeter/14.04. You just reject this merge proposal ?
Robert Ancell (robert-ancell) wrote : | # |
You should update this proposal to apply to trunk and also make one that applies to 14.04 - otherwise users in 15.04 will not have hidpi support. We should also consider making an MP that applies to 14.10. This is easy to do once this is applied to trunk:
$ bzr branch lp:unity-greeter/14.04
$ cd 14.04
$ bzr merge -c <commit> lp:unity-greeter
$ bzr commit
(make merge request)
- 1207. By Woodrow Shen
-
Use get_hidpi_scale function to replace hard-code.
- 1208. By Woodrow Shen
-
Fix the some code style.
- 1209. By Woodrow Shen
-
Fix the correct space number without tab.
Robert Ancell (robert-ancell) wrote : | # |
How does this relate to https:/
Robert Ancell (robert-ancell) wrote : | # |
Rejecting this MP because it's out of sync and according to https:/
Unmerged revisions
- 1209. By Woodrow Shen
-
Fix the correct space number without tab.
- 1208. By Woodrow Shen
-
Fix the some code style.
- 1207. By Woodrow Shen
-
Use get_hidpi_scale function to replace hard-code.
- 1206. By Woodrow Shen
-
This patch try to fix the problem that unity-greeter can't scale on a hidpi display.
Currenly the icons on menubar still don't work, and sometimes menuitem may unchanged
unexpectedly. - 1205. By Robert Ancell
-
Releasing 14.04.10
- 1204. By Robert Ancell
-
Require user to acknowledge messages after last prompt
Preview Diff
1 | === modified file 'NEWS' | |||
2 | --- NEWS 2014-08-21 21:50:24 +0000 | |||
3 | +++ NEWS 2014-11-21 06:18:52 +0000 | |||
4 | @@ -1,3 +1,4 @@ | |||
5 | 1 | <<<<<<< TREE | ||
6 | 1 | Overview of changes in unity-greeter 14.10.2 | 2 | Overview of changes in unity-greeter 14.10.2 |
7 | 2 | 3 | ||
8 | 3 | - Switch the screen reader keyboard shortcut to be the same as the default | 4 | - Switch the screen reader keyboard shortcut to be the same as the default |
9 | @@ -12,6 +13,13 @@ | |||
10 | 12 | - Require user to acknowledge messages received after authentication is | 13 | - Require user to acknowledge messages received after authentication is |
11 | 13 | complete, for example if their password is about to expire. | 14 | complete, for example if their password is about to expire. |
12 | 14 | 15 | ||
13 | 16 | ======= | ||
14 | 17 | Overview of changes in unity-greeter 14.04.10 | ||
15 | 18 | |||
16 | 19 | - Require user to acknowledge messages received after authentication is | ||
17 | 20 | complete, for example if their password is about to expire. | ||
18 | 21 | |||
19 | 22 | >>>>>>> MERGE-SOURCE | ||
20 | 15 | Overview of changes in unity-greeter 14.04.9 | 23 | Overview of changes in unity-greeter 14.04.9 |
21 | 16 | 24 | ||
22 | 17 | - Correctly handle SIGTERM and quit cleanly. We were previously not stopping | 25 | - Correctly handle SIGTERM and quit cleanly. We were previously not stopping |
23 | 18 | 26 | ||
24 | === modified file 'configure.ac' | |||
25 | --- configure.ac 2014-11-04 02:49:30 +0000 | |||
26 | +++ configure.ac 2014-11-21 06:18:52 +0000 | |||
27 | @@ -2,7 +2,11 @@ | |||
28 | 2 | 2 | ||
29 | 3 | dnl Process this file with autoconf to produce a configure script. | 3 | dnl Process this file with autoconf to produce a configure script. |
30 | 4 | 4 | ||
31 | 5 | <<<<<<< TREE | ||
32 | 5 | AC_INIT(unity-greeter, 14.10.2) | 6 | AC_INIT(unity-greeter, 14.10.2) |
33 | 7 | ======= | ||
34 | 8 | AC_INIT(unity-greeter, 14.04.10) | ||
35 | 9 | >>>>>>> MERGE-SOURCE | ||
36 | 6 | AC_CONFIG_MACRO_DIR(m4) | 10 | AC_CONFIG_MACRO_DIR(m4) |
37 | 7 | AM_INIT_AUTOMAKE | 11 | AM_INIT_AUTOMAKE |
38 | 8 | AM_PROG_CC_C_O | 12 | AM_PROG_CC_C_O |
39 | 9 | 13 | ||
40 | === modified file 'debian/changelog' | |||
41 | --- debian/changelog 2014-08-21 21:50:24 +0000 | |||
42 | +++ debian/changelog 2014-11-21 06:18:52 +0000 | |||
43 | @@ -1,3 +1,4 @@ | |||
44 | 1 | <<<<<<< TREE | ||
45 | 1 | unity-greeter (14.10.2-0ubuntu1) utopic; urgency=medium | 2 | unity-greeter (14.10.2-0ubuntu1) utopic; urgency=medium |
46 | 2 | 3 | ||
47 | 3 | * New upstream release: | 4 | * New upstream release: |
48 | @@ -27,6 +28,16 @@ | |||
49 | 27 | 28 | ||
50 | 28 | -- Dimitri John Ledkov <xnox@ubuntu.com> Thu, 24 Apr 2014 00:23:42 +0100 | 29 | -- Dimitri John Ledkov <xnox@ubuntu.com> Thu, 24 Apr 2014 00:23:42 +0100 |
51 | 29 | 30 | ||
52 | 31 | ======= | ||
53 | 32 | unity-greeter (14.04.10-0ubuntu1) trusty; urgency=medium | ||
54 | 33 | |||
55 | 34 | * New upstream release: | ||
56 | 35 | - Require user to acknowledge messages received after authentication is | ||
57 | 36 | complete, for example if their password is about to expire. (LP: #1304866) | ||
58 | 37 | |||
59 | 38 | -- Robert Ancell <robert.ancell@canonical.com> Wed, 30 Apr 2014 15:33:19 +1200 | ||
60 | 39 | |||
61 | 40 | >>>>>>> MERGE-SOURCE | ||
62 | 30 | unity-greeter (14.04.9-0ubuntu1) trusty; urgency=medium | 41 | unity-greeter (14.04.9-0ubuntu1) trusty; urgency=medium |
63 | 31 | 42 | ||
64 | 32 | * New upstream release: | 43 | * New upstream release: |
65 | 33 | 44 | ||
66 | === modified file 'src/cairo-utils.vala' | |||
67 | --- src/cairo-utils.vala 2014-04-30 00:13:06 +0000 | |||
68 | +++ src/cairo-utils.vala 2014-11-21 06:18:52 +0000 | |||
69 | @@ -18,9 +18,36 @@ | |||
70 | 18 | * Mirco "MacSlow" Mueller <mirco.mueller@canonical.com> | 18 | * Mirco "MacSlow" Mueller <mirco.mueller@canonical.com> |
71 | 19 | */ | 19 | */ |
72 | 20 | 20 | ||
73 | 21 | public const int HIDPI_SCALE = 2; | ||
74 | 22 | |||
75 | 21 | namespace CairoUtils | 23 | namespace CairoUtils |
76 | 22 | { | 24 | { |
77 | 23 | 25 | ||
78 | 26 | public bool check_hidpi_display () | ||
79 | 27 | { | ||
80 | 28 | var screen = Gdk.Screen.get_default(); | ||
81 | 29 | var primary = screen.get_primary_monitor(); | ||
82 | 30 | |||
83 | 31 | Gdk.Rectangle area; | ||
84 | 32 | screen.get_monitor_geometry(primary, out area); | ||
85 | 33 | |||
86 | 34 | var diagonal = Math.sqrt (area.width * area.width + area.height * area.height); | ||
87 | 35 | |||
88 | 36 | var width_mm = screen.get_monitor_width_mm(primary); | ||
89 | 37 | var height_mm = screen.get_monitor_height_mm(primary); | ||
90 | 38 | |||
91 | 39 | var diagonal_mm = Math.sqrt (width_mm * width_mm + height_mm * height_mm); | ||
92 | 40 | |||
93 | 41 | var ppi = (int) (diagonal * 25.4 / diagonal_mm); | ||
94 | 42 | |||
95 | 43 | return (ppi >= 192) && (area.height >= 1200); | ||
96 | 44 | } | ||
97 | 45 | |||
98 | 46 | public int get_hidpi_scale () | ||
99 | 47 | { | ||
100 | 48 | return check_hidpi_display() ? HIDPI_SCALE : 1; | ||
101 | 49 | } | ||
102 | 50 | |||
103 | 24 | public void rounded_rectangle (Cairo.Context c, double x, double y, | 51 | public void rounded_rectangle (Cairo.Context c, double x, double y, |
104 | 25 | double width, double height, double radius) | 52 | double width, double height, double radius) |
105 | 26 | { | 53 | { |
106 | 27 | 54 | ||
107 | === modified file 'src/dash-box.vala' | |||
108 | --- src/dash-box.vala 2013-11-12 03:27:13 +0000 | |||
109 | +++ src/dash-box.vala 2014-11-21 06:18:52 +0000 | |||
110 | @@ -156,8 +156,11 @@ | |||
111 | 156 | } | 156 | } |
112 | 157 | else | 157 | else |
113 | 158 | { | 158 | { |
116 | 159 | min = grid_size * GreeterList.DEFAULT_BOX_HEIGHT - GreeterList.BORDER * 2; | 159 | var scale = CairoUtils.get_hidpi_scale(); |
117 | 160 | nat = grid_size * GreeterList.DEFAULT_BOX_HEIGHT - GreeterList.BORDER * 2; | 160 | min = grid_size * GreeterList.DEFAULT_BOX_HEIGHT * scale - GreeterList.BORDER * |
118 | 161 | scale * 2; | ||
119 | 162 | nat = grid_size * GreeterList.DEFAULT_BOX_HEIGHT * scale - GreeterList.BORDER * | ||
120 | 163 | scale * 2; | ||
121 | 161 | } | 164 | } |
122 | 162 | } | 165 | } |
123 | 163 | else | 166 | else |
124 | @@ -175,8 +178,9 @@ | |||
125 | 175 | 178 | ||
126 | 176 | public override void get_preferred_width (out int min, out int nat) | 179 | public override void get_preferred_width (out int min, out int nat) |
127 | 177 | { | 180 | { |
130 | 178 | min = grid_size * GreeterList.BOX_WIDTH - GreeterList.BORDER * 2; | 181 | var scale = CairoUtils.get_hidpi_scale(); |
131 | 179 | nat = grid_size * GreeterList.BOX_WIDTH - GreeterList.BORDER * 2; | 182 | min = grid_size * GreeterList.BOX_WIDTH * scale - GreeterList.BORDER * scale * 2; |
132 | 183 | nat = grid_size * GreeterList.BOX_WIDTH * scale - GreeterList.BORDER * scale * 2; | ||
133 | 180 | } | 184 | } |
134 | 181 | 185 | ||
135 | 182 | public override bool draw (Cairo.Context c) | 186 | public override bool draw (Cairo.Context c) |
136 | 183 | 187 | ||
137 | === modified file 'src/dash-button.vala' | |||
138 | --- src/dash-button.vala 2013-01-04 16:56:55 +0000 | |||
139 | +++ src/dash-button.vala 2014-11-21 06:18:52 +0000 | |||
140 | @@ -29,7 +29,9 @@ | |||
141 | 29 | set | 29 | set |
142 | 30 | { | 30 | { |
143 | 31 | _text = value; | 31 | _text = value; |
145 | 32 | text_label.set_markup ("<span font=\"Ubuntu 13\">%s</span>".printf (value)); | 32 | var font_size = 13 * CairoUtils.get_hidpi_scale(); |
146 | 33 | var font = "<span font=\"Ubuntu %d\">%s</span>".printf (font_size, value); | ||
147 | 34 | text_label.set_markup (font.printf (value)); | ||
148 | 33 | } | 35 | } |
149 | 34 | } | 36 | } |
150 | 35 | 37 | ||
151 | 36 | 38 | ||
152 | === modified file 'src/dash-entry.vala' | |||
153 | --- src/dash-entry.vala 2013-02-20 16:17:42 +0000 | |||
154 | +++ src/dash-entry.vala 2014-11-21 06:18:52 +0000 | |||
155 | @@ -23,7 +23,6 @@ | |||
156 | 23 | 23 | ||
157 | 24 | public class DashEntry : Gtk.Entry, Fadable | 24 | public class DashEntry : Gtk.Entry, Fadable |
158 | 25 | { | 25 | { |
159 | 26 | public static string font = "Ubuntu 14"; | ||
160 | 27 | public signal void respond (); | 26 | public signal void respond (); |
161 | 28 | 27 | ||
162 | 29 | public string constant_placeholder_text { get; set; } | 28 | public string constant_placeholder_text { get; set; } |
163 | @@ -73,7 +72,10 @@ | |||
164 | 73 | } | 72 | } |
165 | 74 | } | 73 | } |
166 | 75 | 74 | ||
168 | 76 | override_font (Pango.FontDescription.from_string (font)); | 75 | var font_size = 14 * CairoUtils.get_hidpi_scale(); |
169 | 76 | var set_font = "Ubuntu " + font_size.to_string(); | ||
170 | 77 | |||
171 | 78 | override_font (Pango.FontDescription.from_string (set_font)); | ||
172 | 77 | 79 | ||
173 | 78 | var style_ctx = get_style_context (); | 80 | var style_ctx = get_style_context (); |
174 | 79 | 81 | ||
175 | @@ -187,7 +189,10 @@ | |||
176 | 187 | 189 | ||
177 | 188 | /* Draw text */ | 190 | /* Draw text */ |
178 | 189 | var layout = create_pango_layout (constant_placeholder_text); | 191 | var layout = create_pango_layout (constant_placeholder_text); |
180 | 190 | layout.set_font_description (Pango.FontDescription.from_string ("Ubuntu 13")); | 192 | var font_size = 13 * CairoUtils.get_hidpi_scale(); |
181 | 193 | var set_font = "Ubuntu " + font_size.to_string(); | ||
182 | 194 | |||
183 | 195 | layout.set_font_description (Pango.FontDescription.from_string (set_font)); | ||
184 | 191 | Pango.cairo_show_layout (c, layout); | 196 | Pango.cairo_show_layout (c, layout); |
185 | 192 | 197 | ||
186 | 193 | c.restore (); | 198 | c.restore (); |
187 | 194 | 199 | ||
188 | === modified file 'src/greeter-list.vala' | |||
189 | --- src/greeter-list.vala 2014-04-30 00:11:07 +0000 | |||
190 | +++ src/greeter-list.vala 2014-11-21 06:18:52 +0000 | |||
191 | @@ -92,6 +92,7 @@ | |||
192 | 92 | private Gtk.Fixed fixed; | 92 | private Gtk.Fixed fixed; |
193 | 93 | public DashBox greeter_box; | 93 | public DashBox greeter_box; |
194 | 94 | private int cached_box_height = -1; | 94 | private int cached_box_height = -1; |
195 | 95 | private int scale; | ||
196 | 95 | 96 | ||
197 | 96 | protected enum Mode | 97 | protected enum Mode |
198 | 97 | { | 98 | { |
199 | @@ -118,7 +119,7 @@ | |||
200 | 118 | { | 119 | { |
201 | 119 | /* First, get grid row number as if menubar weren't there */ | 120 | /* First, get grid row number as if menubar weren't there */ |
202 | 120 | var row = (MainWindow.MENUBAR_HEIGHT + get_allocated_height ()) / grid_size; | 121 | var row = (MainWindow.MENUBAR_HEIGHT + get_allocated_height ()) / grid_size; |
204 | 121 | row = row - DEFAULT_BOX_HEIGHT; /* and no default dash box */ | 122 | row = row - (DEFAULT_BOX_HEIGHT * scale); /* and no default dash box */ |
205 | 122 | row = row / 2; /* and in the middle */ | 123 | row = row / 2; /* and in the middle */ |
206 | 123 | /* Now calculate y pixel spot keeping in mind menubar's allocation */ | 124 | /* Now calculate y pixel spot keeping in mind menubar's allocation */ |
207 | 124 | return row * grid_size - MainWindow.MENUBAR_HEIGHT; | 125 | return row * grid_size - MainWindow.MENUBAR_HEIGHT; |
208 | @@ -193,6 +194,8 @@ | |||
209 | 193 | { | 194 | { |
210 | 194 | debug ("Error getting session bus: %s", e.message); | 195 | debug ("Error getting session bus: %s", e.message); |
211 | 195 | } | 196 | } |
212 | 197 | |||
213 | 198 | scale = CairoUtils.get_hidpi_scale(); | ||
214 | 196 | } | 199 | } |
215 | 197 | 200 | ||
216 | 198 | private void on_bus_acquired (Object? obj, AsyncResult res) | 201 | private void on_bus_acquired (Object? obj, AsyncResult res) |
217 | @@ -219,8 +222,8 @@ | |||
218 | 219 | 222 | ||
219 | 220 | public override void get_preferred_width (out int min, out int nat) | 223 | public override void get_preferred_width (out int min, out int nat) |
220 | 221 | { | 224 | { |
223 | 222 | min = BOX_WIDTH * grid_size; | 225 | min = BOX_WIDTH * scale * grid_size; |
224 | 223 | nat = BOX_WIDTH * grid_size; | 226 | nat = BOX_WIDTH * scale * grid_size; |
225 | 224 | } | 227 | } |
226 | 225 | 228 | ||
227 | 226 | public override void get_preferred_height (out int min, out int nat) | 229 | public override void get_preferred_height (out int min, out int nat) |
228 | @@ -390,7 +393,8 @@ | |||
229 | 390 | protected void add_entry (PromptBox entry) | 393 | protected void add_entry (PromptBox entry) |
230 | 391 | { | 394 | { |
231 | 392 | entry.expand = true; | 395 | entry.expand = true; |
233 | 393 | entry.set_size_request (grid_size * BOX_WIDTH - BORDER * 2, -1); | 396 | |
234 | 397 | entry.set_size_request (grid_size * (BOX_WIDTH * scale) - (BORDER * scale) * 2, -1); | ||
235 | 394 | add_with_class (entry); | 398 | add_with_class (entry); |
236 | 395 | 399 | ||
237 | 396 | insert_entry (entry); | 400 | insert_entry (entry); |
238 | @@ -493,12 +497,12 @@ | |||
239 | 493 | 497 | ||
240 | 494 | protected int get_greeter_box_x () | 498 | protected int get_greeter_box_x () |
241 | 495 | { | 499 | { |
243 | 496 | return box_x + BORDER; | 500 | return box_x + (BORDER * scale); |
244 | 497 | } | 501 | } |
245 | 498 | 502 | ||
246 | 499 | protected int get_greeter_box_y () | 503 | protected int get_greeter_box_y () |
247 | 500 | { | 504 | { |
249 | 501 | return box_y + BORDER; | 505 | return box_y + (BORDER * scale); |
250 | 502 | } | 506 | } |
251 | 503 | 507 | ||
252 | 504 | protected virtual int get_position_y (double position) | 508 | protected virtual int get_position_y (double position) |
253 | @@ -534,7 +538,7 @@ | |||
254 | 534 | get_allocation (out allocation); | 538 | get_allocation (out allocation); |
255 | 535 | 539 | ||
256 | 536 | var child_allocation = Gtk.Allocation (); | 540 | var child_allocation = Gtk.Allocation (); |
258 | 537 | child_allocation.width = grid_size * BOX_WIDTH - BORDER * 2; | 541 | child_allocation.width = grid_size * (BOX_WIDTH * scale) - (BORDER * scale) * 2; |
259 | 538 | entry.get_preferred_height_for_width (child_allocation.width, null, out child_allocation.height); | 542 | entry.get_preferred_height_for_width (child_allocation.width, null, out child_allocation.height); |
260 | 539 | child_allocation.x = allocation.x + get_greeter_box_x (); | 543 | child_allocation.x = allocation.x + get_greeter_box_x (); |
261 | 540 | child_allocation.y = allocation.y + get_position_y (position); | 544 | child_allocation.y = allocation.y + get_position_y (position); |
262 | @@ -735,7 +739,8 @@ | |||
263 | 735 | c.save (); | 739 | c.save (); |
264 | 736 | c.push_group (); | 740 | c.push_group (); |
265 | 737 | 741 | ||
267 | 738 | c.rectangle (get_greeter_box_x (), get_greeter_box_y () - n_above * grid_size, grid_size * BOX_WIDTH - BORDER * 2, grid_size * (n_above + n_below + get_greeter_box_height_grids ())); | 742 | c.rectangle (get_greeter_box_x (), get_greeter_box_y () - n_above * grid_size, grid_size |
268 | 743 | * (BOX_WIDTH * scale)- (BORDER * scale) * 2, grid_size * (n_above + n_below + get_greeter_box_height_grids ())); | ||
269 | 739 | c.clip (); | 744 | c.clip (); |
270 | 740 | 745 | ||
271 | 741 | foreach (var child in fixed.get_children ()) | 746 | foreach (var child in fixed.get_children ()) |
272 | 742 | 747 | ||
273 | === modified file 'src/list-stack.vala' | |||
274 | --- src/list-stack.vala 2012-08-27 22:30:33 +0000 | |||
275 | +++ src/list-stack.vala 2014-11-21 06:18:52 +0000 | |||
276 | @@ -32,7 +32,8 @@ | |||
277 | 32 | 32 | ||
278 | 33 | construct | 33 | construct |
279 | 34 | { | 34 | { |
281 | 35 | width = grid_size * GreeterList.BOX_WIDTH; | 35 | var scale = CairoUtils.get_hidpi_scale(); |
282 | 36 | width = grid_size * GreeterList.BOX_WIDTH * scale; | ||
283 | 36 | } | 37 | } |
284 | 37 | 38 | ||
285 | 38 | public GreeterList? top () | 39 | public GreeterList? top () |
286 | 39 | 40 | ||
287 | === modified file 'src/main-window.vala' | |||
288 | --- src/main-window.vala 2014-03-26 21:25:01 +0000 | |||
289 | +++ src/main-window.vala 2014-11-21 06:18:52 +0000 | |||
290 | @@ -88,7 +88,10 @@ | |||
291 | 88 | { | 88 | { |
292 | 89 | debug ("Internal error loading menubox style: %s", e.message); | 89 | debug ("Internal error loading menubox style: %s", e.message); |
293 | 90 | } | 90 | } |
295 | 91 | menubox.set_size_request (-1, MENUBAR_HEIGHT); | 91 | |
296 | 92 | var scale = CairoUtils.get_hidpi_scale(); | ||
297 | 93 | |||
298 | 94 | menubox.set_size_request (-1, MENUBAR_HEIGHT * scale); | ||
299 | 92 | menubox.show (); | 95 | menubox.show (); |
300 | 93 | menualign.show (); | 96 | menualign.show (); |
301 | 94 | menubox.add (menualign); | 97 | menubox.add (menualign); |
302 | 95 | 98 | ||
303 | === modified file 'src/menubar.vala' | |||
304 | --- src/menubar.vala 2014-08-21 04:39:56 +0000 | |||
305 | +++ src/menubar.vala 2014-11-21 06:18:52 +0000 | |||
306 | @@ -115,6 +115,7 @@ | |||
307 | 115 | private Pid keyboard_pid = 0; | 115 | private Pid keyboard_pid = 0; |
308 | 116 | private Pid reader_pid = 0; | 116 | private Pid reader_pid = 0; |
309 | 117 | private Gtk.CheckMenuItem onscreen_keyboard_item; | 117 | private Gtk.CheckMenuItem onscreen_keyboard_item; |
310 | 118 | private int scale; | ||
311 | 118 | 119 | ||
312 | 119 | construct | 120 | construct |
313 | 120 | { | 121 | { |
314 | @@ -122,6 +123,8 @@ | |||
315 | 122 | 123 | ||
316 | 123 | pack_direction = Gtk.PackDirection.RTL; | 124 | pack_direction = Gtk.PackDirection.RTL; |
317 | 124 | 125 | ||
318 | 126 | scale = CairoUtils.get_hidpi_scale(); | ||
319 | 127 | |||
320 | 125 | if (UGSettings.get_boolean (UGSettings.KEY_SHOW_HOSTNAME)) | 128 | if (UGSettings.get_boolean (UGSettings.KEY_SHOW_HOSTNAME)) |
321 | 126 | { | 129 | { |
322 | 127 | var label = new Gtk.Label (Posix.utsname ().nodename); | 130 | var label = new Gtk.Label (Posix.utsname ().nodename); |
323 | @@ -137,6 +140,8 @@ | |||
324 | 137 | label.ensure_style (); | 140 | label.ensure_style (); |
325 | 138 | var fg = label.get_style_context ().get_color (Gtk.StateFlags.NORMAL); | 141 | var fg = label.get_style_context ().get_color (Gtk.StateFlags.NORMAL); |
326 | 139 | label.override_color (Gtk.StateFlags.INSENSITIVE, fg); | 142 | label.override_color (Gtk.StateFlags.INSENSITIVE, fg); |
327 | 143 | var font = 12 * scale; | ||
328 | 144 | label.override_font (Pango.FontDescription.from_string (font.to_string())); | ||
329 | 140 | } | 145 | } |
330 | 141 | 146 | ||
331 | 142 | /* Prevent dragging the window by the menubar */ | 147 | /* Prevent dragging the window by the menubar */ |
332 | @@ -175,8 +180,8 @@ | |||
333 | 175 | 180 | ||
334 | 176 | public override void get_preferred_height (out int min, out int nat) | 181 | public override void get_preferred_height (out int min, out int nat) |
335 | 177 | { | 182 | { |
338 | 178 | min = HEIGHT; | 183 | min = HEIGHT * scale; |
339 | 179 | nat = HEIGHT; | 184 | nat = HEIGHT * scale; |
340 | 180 | } | 185 | } |
341 | 181 | 186 | ||
342 | 182 | private void greeter_set_env (string key, string val) | 187 | private void greeter_set_env (string key, string val) |
343 | @@ -218,17 +223,21 @@ | |||
344 | 218 | a11y_item.show (); | 223 | a11y_item.show (); |
345 | 219 | a11y_item.set_submenu (new Gtk.Menu () as Gtk.Widget); | 224 | a11y_item.set_submenu (new Gtk.Menu () as Gtk.Widget); |
346 | 220 | onscreen_keyboard_item = new Gtk.CheckMenuItem.with_label (_("Onscreen keyboard")); | 225 | onscreen_keyboard_item = new Gtk.CheckMenuItem.with_label (_("Onscreen keyboard")); |
347 | 226 | var font = 12 * scale; | ||
348 | 227 | onscreen_keyboard_item.override_font (Pango.FontDescription.from_string (font.to_string())); | ||
349 | 221 | onscreen_keyboard_item.toggled.connect (keyboard_toggled_cb); | 228 | onscreen_keyboard_item.toggled.connect (keyboard_toggled_cb); |
350 | 222 | onscreen_keyboard_item.show (); | 229 | onscreen_keyboard_item.show (); |
351 | 223 | unowned Gtk.Menu submenu = a11y_item.submenu; | 230 | unowned Gtk.Menu submenu = a11y_item.submenu; |
352 | 224 | submenu.append (onscreen_keyboard_item); | 231 | submenu.append (onscreen_keyboard_item); |
353 | 225 | high_contrast_item = new Gtk.CheckMenuItem.with_label (_("High Contrast")); | 232 | high_contrast_item = new Gtk.CheckMenuItem.with_label (_("High Contrast")); |
354 | 233 | high_contrast_item.override_font (Pango.FontDescription.from_string (font.to_string())); | ||
355 | 226 | high_contrast_item.toggled.connect (high_contrast_toggled_cb); | 234 | high_contrast_item.toggled.connect (high_contrast_toggled_cb); |
356 | 227 | high_contrast_item.add_accelerator ("activate", accel_group, Gdk.Key.h, Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE); | 235 | high_contrast_item.add_accelerator ("activate", accel_group, Gdk.Key.h, Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE); |
357 | 228 | high_contrast_item.show (); | 236 | high_contrast_item.show (); |
358 | 229 | submenu.append (high_contrast_item); | 237 | submenu.append (high_contrast_item); |
359 | 230 | high_contrast_item.set_active (UGSettings.get_boolean (UGSettings.KEY_HIGH_CONTRAST)); | 238 | high_contrast_item.set_active (UGSettings.get_boolean (UGSettings.KEY_HIGH_CONTRAST)); |
360 | 231 | var item = new Gtk.CheckMenuItem.with_label (_("Screen Reader")); | 239 | var item = new Gtk.CheckMenuItem.with_label (_("Screen Reader")); |
361 | 240 | item.override_font (Pango.FontDescription.from_string (font.to_string())); | ||
362 | 232 | item.toggled.connect (screen_reader_toggled_cb); | 241 | item.toggled.connect (screen_reader_toggled_cb); |
363 | 233 | item.add_accelerator ("activate", accel_group, Gdk.Key.s, Gdk.ModifierType.SUPER_MASK | Gdk.ModifierType.MOD1_MASK, Gtk.AccelFlags.VISIBLE); | 242 | item.add_accelerator ("activate", accel_group, Gdk.Key.s, Gdk.ModifierType.SUPER_MASK | Gdk.ModifierType.MOD1_MASK, Gtk.AccelFlags.VISIBLE); |
364 | 234 | item.show (); | 243 | item.show (); |
365 | @@ -527,6 +536,9 @@ | |||
366 | 527 | break; | 536 | break; |
367 | 528 | 537 | ||
368 | 529 | var menuitem = (IndicatorMenuItem) child; | 538 | var menuitem = (IndicatorMenuItem) child; |
369 | 539 | var font = 12 * scale; | ||
370 | 540 | menuitem.override_font (Pango.FontDescription.from_string (font.to_string())); | ||
371 | 541 | menuitem.entry.label.override_font (Pango.FontDescription.from_string (font.to_string())); | ||
372 | 530 | var child_object = get_indicator_object_from_entry (menuitem.entry); | 542 | var child_object = get_indicator_object_from_entry (menuitem.entry); |
373 | 531 | var child_index = get_indicator_index (child_object); | 543 | var child_index = get_indicator_index (child_object); |
374 | 532 | if (child_index > index) | 544 | if (child_index > index) |
375 | 533 | 545 | ||
376 | === modified file 'src/prompt-box.vala' | |||
377 | --- src/prompt-box.vala 2013-01-01 20:26:59 +0000 | |||
378 | +++ src/prompt-box.vala 2014-11-21 06:18:52 +0000 | |||
379 | @@ -71,6 +71,9 @@ | |||
380 | 71 | protected static const int COL_ENTRIES_END = 1; | 71 | protected static const int COL_ENTRIES_END = 1; |
381 | 72 | protected static const int COL_ENTRIES_WIDTH = 1; | 72 | protected static const int COL_ENTRIES_WIDTH = 1; |
382 | 73 | 73 | ||
383 | 74 | protected static const int MSG_FONT_SIZE = 10; | ||
384 | 75 | protected static const int LAB_FONT_SIZE = 13; | ||
385 | 76 | |||
386 | 74 | protected int start_row; | 77 | protected int start_row; |
387 | 75 | protected int last_row; | 78 | protected int last_row; |
388 | 76 | 79 | ||
389 | @@ -87,12 +90,16 @@ | |||
390 | 87 | Object (id: id); | 90 | Object (id: id); |
391 | 88 | } | 91 | } |
392 | 89 | 92 | ||
393 | 93 | private int scale; | ||
394 | 94 | |||
395 | 90 | construct | 95 | construct |
396 | 91 | { | 96 | { |
397 | 92 | set_start_row (); | 97 | set_start_row (); |
398 | 93 | reset_last_row (); | 98 | reset_last_row (); |
399 | 94 | expand = true; | 99 | expand = true; |
400 | 95 | 100 | ||
401 | 101 | scale = CairoUtils.get_hidpi_scale(); | ||
402 | 102 | |||
403 | 96 | fixed = new Gtk.Fixed (); | 103 | fixed = new Gtk.Fixed (); |
404 | 97 | fixed.show (); | 104 | fixed.show (); |
405 | 98 | add (fixed); | 105 | add (fixed); |
406 | @@ -100,7 +107,7 @@ | |||
407 | 100 | box_grid = new Gtk.Grid (); | 107 | box_grid = new Gtk.Grid (); |
408 | 101 | box_grid.column_spacing = 4; | 108 | box_grid.column_spacing = 4; |
409 | 102 | box_grid.row_spacing = 3; | 109 | box_grid.row_spacing = 3; |
411 | 103 | box_grid.margin_top = GreeterList.BORDER; | 110 | box_grid.margin_top = GreeterList.BORDER * scale; |
412 | 104 | box_grid.margin_bottom = 6; | 111 | box_grid.margin_bottom = 6; |
413 | 105 | box_grid.expand = true; | 112 | box_grid.expand = true; |
414 | 106 | 113 | ||
415 | @@ -171,8 +178,11 @@ | |||
416 | 171 | name_grid.column_spacing = 4; | 178 | name_grid.column_spacing = 4; |
417 | 172 | name_grid.hexpand = true; | 179 | name_grid.hexpand = true; |
418 | 173 | 180 | ||
419 | 181 | int font_size = LAB_FONT_SIZE * scale; | ||
420 | 182 | string font = "Ubuntu " + font_size.to_string(); | ||
421 | 183 | |||
422 | 174 | name_label = new FadingLabel (""); | 184 | name_label = new FadingLabel (""); |
424 | 175 | name_label.override_font (Pango.FontDescription.from_string ("Ubuntu 13")); | 185 | name_label.override_font (Pango.FontDescription.from_string (font)); |
425 | 176 | name_label.override_color (Gtk.StateFlags.NORMAL, { 1.0f, 1.0f, 1.0f, 1.0f }); | 186 | name_label.override_color (Gtk.StateFlags.NORMAL, { 1.0f, 1.0f, 1.0f, 1.0f }); |
426 | 177 | name_label.valign = Gtk.Align.START; | 187 | name_label.valign = Gtk.Align.START; |
427 | 178 | name_label.vexpand = true; | 188 | name_label.vexpand = true; |
428 | @@ -235,8 +245,11 @@ | |||
429 | 235 | var small_name_grid = new Gtk.Grid (); | 245 | var small_name_grid = new Gtk.Grid (); |
430 | 236 | small_name_grid.column_spacing = 4; | 246 | small_name_grid.column_spacing = 4; |
431 | 237 | 247 | ||
432 | 248 | var font_size = LAB_FONT_SIZE * scale; | ||
433 | 249 | var font = "Ubuntu " + font_size.to_string(); | ||
434 | 250 | |||
435 | 238 | small_name_label = new FadingLabel (""); | 251 | small_name_label = new FadingLabel (""); |
437 | 239 | small_name_label.override_font (Pango.FontDescription.from_string ("Ubuntu 13")); | 252 | small_name_label.override_font (Pango.FontDescription.from_string (font)); |
438 | 240 | small_name_label.override_color (Gtk.StateFlags.NORMAL, { 1.0f, 1.0f, 1.0f, 1.0f }); | 253 | small_name_label.override_color (Gtk.StateFlags.NORMAL, { 1.0f, 1.0f, 1.0f, 1.0f }); |
439 | 241 | small_name_label.yalign = 0.5f; | 254 | small_name_label.yalign = 0.5f; |
440 | 242 | small_name_label.xalign = 0.0f; | 255 | small_name_label.xalign = 0.0f; |
441 | @@ -281,8 +294,8 @@ | |||
442 | 281 | public override void get_preferred_height (out int min, out int nat) | 294 | public override void get_preferred_height (out int min, out int nat) |
443 | 282 | { | 295 | { |
444 | 283 | base.get_preferred_height (out min, out nat); | 296 | base.get_preferred_height (out min, out nat); |
447 | 284 | min = round_to_grid (min + GreeterList.BORDER * 2) - GreeterList.BORDER * 2; | 297 | min = round_to_grid (min + GreeterList.BORDER * scale * 2) - GreeterList.BORDER * scale * 2; |
448 | 285 | nat = round_to_grid (nat + GreeterList.BORDER * 2) - GreeterList.BORDER * 2; | 298 | nat = round_to_grid (nat + GreeterList.BORDER * scale * 2) - GreeterList.BORDER * scale * 2; |
449 | 286 | } | 299 | } |
450 | 287 | 300 | ||
451 | 288 | public void set_zone (Gtk.Widget zone) | 301 | public void set_zone (Gtk.Widget zone) |
452 | @@ -435,8 +448,10 @@ | |||
453 | 435 | public void add_message (string text, bool is_error) | 448 | public void add_message (string text, bool is_error) |
454 | 436 | { | 449 | { |
455 | 437 | var label = new FadingLabel (text); | 450 | var label = new FadingLabel (text); |
456 | 451 | var font_size = MSG_FONT_SIZE * scale; | ||
457 | 452 | var font = "Ubuntu " + font_size.to_string(); | ||
458 | 438 | 453 | ||
460 | 439 | label.override_font (Pango.FontDescription.from_string ("Ubuntu 10")); | 454 | label.override_font (Pango.FontDescription.from_string (font)); |
461 | 440 | 455 | ||
462 | 441 | Gdk.RGBA color = { 1.0f, 1.0f, 1.0f, 1.0f }; | 456 | Gdk.RGBA color = { 1.0f, 1.0f, 1.0f, 1.0f }; |
463 | 442 | if (is_error) | 457 | if (is_error) |
464 | @@ -514,7 +529,9 @@ | |||
465 | 514 | 529 | ||
466 | 515 | combo.get_style_context ().add_class ("lightdm-combo"); | 530 | combo.get_style_context ().add_class ("lightdm-combo"); |
467 | 516 | combo.get_child ().get_style_context ().add_class ("lightdm-combo"); | 531 | combo.get_child ().get_style_context ().add_class ("lightdm-combo"); |
469 | 517 | combo.get_child ().override_font (Pango.FontDescription.from_string (DashEntry.font)); | 532 | var font_size = 14 * CairoUtils.get_hidpi_scale(); |
470 | 533 | var font = "Ubuntu " + font_size.to_string(); | ||
471 | 534 | combo.get_child ().override_font (Pango.FontDescription.from_string (font)); | ||
472 | 518 | 535 | ||
473 | 519 | attach_item (combo, false); | 536 | attach_item (combo, false); |
474 | 520 | 537 | ||
475 | @@ -644,13 +661,13 @@ | |||
476 | 644 | 661 | ||
477 | 645 | public override void get_preferred_width (out int min, out int nat) | 662 | public override void get_preferred_width (out int min, out int nat) |
478 | 646 | { | 663 | { |
480 | 647 | min = WIDTH; | 664 | min = WIDTH * CairoUtils.get_hidpi_scale(); |
481 | 648 | nat = min; | 665 | nat = min; |
482 | 649 | } | 666 | } |
483 | 650 | 667 | ||
484 | 651 | public override void get_preferred_height (out int min, out int nat) | 668 | public override void get_preferred_height (out int min, out int nat) |
485 | 652 | { | 669 | { |
487 | 653 | min = HEIGHT; | 670 | min = HEIGHT * CairoUtils.get_hidpi_scale(); |
488 | 654 | nat = min; | 671 | nat = min; |
489 | 655 | } | 672 | } |
490 | 656 | 673 | ||
491 | 657 | 674 | ||
492 | === modified file 'src/shutdown-dialog.vala' | |||
493 | --- src/shutdown-dialog.vala 2014-03-26 20:46:06 +0000 | |||
494 | +++ src/shutdown-dialog.vala 2014-11-21 06:18:52 +0000 | |||
495 | @@ -56,6 +56,7 @@ | |||
496 | 56 | 56 | ||
497 | 57 | private AnimateTimer animation; | 57 | private AnimateTimer animation; |
498 | 58 | private bool closing = false; | 58 | private bool closing = false; |
499 | 59 | private int scale; | ||
500 | 59 | 60 | ||
501 | 60 | 61 | ||
502 | 61 | public ShutdownDialog (ShutdownDialogType type, Background bg) | 62 | public ShutdownDialog (ShutdownDialogType type, Background bg) |
503 | @@ -76,14 +77,16 @@ | |||
504 | 76 | }); | 77 | }); |
505 | 77 | add (monitor_events); | 78 | add (monitor_events); |
506 | 78 | 79 | ||
508 | 79 | vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 10); | 80 | scale = CairoUtils.get_hidpi_scale(); |
509 | 81 | |||
510 | 82 | vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 10 * scale); | ||
511 | 80 | vbox.visible = true; | 83 | vbox.visible = true; |
512 | 81 | 84 | ||
513 | 82 | vbox.margin = BORDER_INTERNAL_SIZE; | 85 | vbox.margin = BORDER_INTERNAL_SIZE; |
518 | 83 | vbox.margin_top += 9; | 86 | vbox.margin_top += 9 * scale ; |
519 | 84 | vbox.margin_left += 20; | 87 | vbox.margin_left += 20 * scale; |
520 | 85 | vbox.margin_right += 20; | 88 | vbox.margin_right += 20 * scale; |
521 | 86 | vbox.margin_bottom += 2; | 89 | vbox.margin_bottom += 2 * scale; |
522 | 87 | 90 | ||
523 | 88 | // This event box consumes the click events inside the vbox | 91 | // This event box consumes the click events inside the vbox |
524 | 89 | vbox_events = new Gtk.EventBox(); | 92 | vbox_events = new Gtk.EventBox(); |
525 | @@ -104,7 +107,9 @@ | |||
526 | 104 | { | 107 | { |
527 | 105 | var title_label = new Gtk.Label (_("Shut Down")); | 108 | var title_label = new Gtk.Label (_("Shut Down")); |
528 | 106 | title_label.visible = true; | 109 | title_label.visible = true; |
530 | 107 | title_label.override_font (Pango.FontDescription.from_string ("Ubuntu Light 15")); | 110 | var font_size = 15 * scale; |
531 | 111 | var font = "Ubuntu Light " + font_size.to_string(); | ||
532 | 112 | title_label.override_font (Pango.FontDescription.from_string (font)); | ||
533 | 108 | title_label.override_color (Gtk.StateFlags.NORMAL, { 1.0f, 1.0f, 1.0f, 1.0f }); | 113 | title_label.override_color (Gtk.StateFlags.NORMAL, { 1.0f, 1.0f, 1.0f, 1.0f }); |
534 | 109 | title_label.set_alignment (0.0f, 0.5f); | 114 | title_label.set_alignment (0.0f, 0.5f); |
535 | 110 | vbox.pack_start (title_label, false, false, 0); | 115 | vbox.pack_start (title_label, false, false, 0); |
536 | @@ -138,13 +143,15 @@ | |||
537 | 138 | 143 | ||
538 | 139 | var label = new Gtk.Label (text); | 144 | var label = new Gtk.Label (text); |
539 | 140 | label.set_line_wrap (true); | 145 | label.set_line_wrap (true); |
541 | 141 | label.override_font (Pango.FontDescription.from_string ("Ubuntu Light 12")); | 146 | var font_size = 12 * scale; |
542 | 147 | var font = "Ubuntu Light " + font_size.to_string(); | ||
543 | 148 | label.override_font (Pango.FontDescription.from_string (font)); | ||
544 | 142 | label.override_color (Gtk.StateFlags.NORMAL, { 1.0f, 1.0f, 1.0f, 1.0f }); | 149 | label.override_color (Gtk.StateFlags.NORMAL, { 1.0f, 1.0f, 1.0f, 1.0f }); |
545 | 143 | label.set_alignment (0.0f, 0.5f); | 150 | label.set_alignment (0.0f, 0.5f); |
546 | 144 | label.visible = true; | 151 | label.visible = true; |
547 | 145 | vbox.pack_start (label, false, false, 0); | 152 | vbox.pack_start (label, false, false, 0); |
548 | 146 | 153 | ||
550 | 147 | button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 20); | 154 | button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 20 * 2); |
551 | 148 | button_box.visible = true; | 155 | button_box.visible = true; |
552 | 149 | vbox.pack_start (button_box, false, false, 0); | 156 | vbox.pack_start (button_box, false, false, 0); |
553 | 150 | 157 | ||
554 | @@ -541,6 +548,7 @@ | |||
555 | 541 | private string? active_filename; | 548 | private string? active_filename; |
556 | 542 | private Gtk.Image i; | 549 | private Gtk.Image i; |
557 | 543 | private Gtk.Label? l; | 550 | private Gtk.Label? l; |
558 | 551 | private int scale; | ||
559 | 544 | 552 | ||
560 | 545 | public DialogButton (string inactive_filename, string focused_filename, string? active_filename, Gtk.Label? label = null) | 553 | public DialogButton (string inactive_filename, string focused_filename, string? active_filename, Gtk.Label? label = null) |
561 | 546 | { | 554 | { |
562 | @@ -550,6 +558,11 @@ | |||
563 | 550 | relief = Gtk.ReliefStyle.NONE; | 558 | relief = Gtk.ReliefStyle.NONE; |
564 | 551 | focus_on_click = false; | 559 | focus_on_click = false; |
565 | 552 | i = new Gtk.Image.from_file (inactive_filename); | 560 | i = new Gtk.Image.from_file (inactive_filename); |
566 | 561 | scale = CairoUtils.get_hidpi_scale(); | ||
567 | 562 | int h = i.pixbuf.height; | ||
568 | 563 | int w = i.pixbuf.width; | ||
569 | 564 | var pixbuf = i.pixbuf.scale_simple(h * scale, w * scale, Gdk.InterpType.BILINEAR); | ||
570 | 565 | i.set_from_pixbuf(pixbuf); | ||
571 | 553 | i.visible = true; | 566 | i.visible = true; |
572 | 554 | add (i); | 567 | add (i); |
573 | 555 | 568 | ||
574 | @@ -558,7 +571,9 @@ | |||
575 | 558 | if (l != null) | 571 | if (l != null) |
576 | 559 | { | 572 | { |
577 | 560 | l.visible = true; | 573 | l.visible = true; |
579 | 561 | l.override_font (Pango.FontDescription.from_string ("Ubuntu Light 12")); | 574 | var font_size = 12 * scale; |
580 | 575 | var font = "Ubuntu Light " + font_size.to_string(); | ||
581 | 576 | l.override_font (Pango.FontDescription.from_string (font)); | ||
582 | 562 | l.override_color (Gtk.StateFlags.NORMAL, { 1.0f, 1.0f, 1.0f, 0.0f }); | 577 | l.override_color (Gtk.StateFlags.NORMAL, { 1.0f, 1.0f, 1.0f, 0.0f }); |
583 | 563 | l.override_color (Gtk.StateFlags.FOCUSED, { 1.0f, 1.0f, 1.0f, 1.0f }); | 578 | l.override_color (Gtk.StateFlags.FOCUSED, { 1.0f, 1.0f, 1.0f, 1.0f }); |
584 | 564 | l.override_color (Gtk.StateFlags.ACTIVE, { 1.0f, 1.0f, 1.0f, 1.0f }); | 579 | l.override_color (Gtk.StateFlags.ACTIVE, { 1.0f, 1.0f, 1.0f, 1.0f }); |
585 | @@ -605,13 +620,32 @@ | |||
586 | 605 | (new_flags & Gtk.StateFlags.FOCUSED) != 0) | 620 | (new_flags & Gtk.StateFlags.FOCUSED) != 0) |
587 | 606 | { | 621 | { |
588 | 607 | if ((new_flags & Gtk.StateFlags.ACTIVE) != 0 && active_filename != null) | 622 | if ((new_flags & Gtk.StateFlags.ACTIVE) != 0 && active_filename != null) |
589 | 623 | { | ||
590 | 608 | i.set_from_file (active_filename); | 624 | i.set_from_file (active_filename); |
591 | 625 | |||
592 | 626 | int h = i.pixbuf.height; | ||
593 | 627 | int w = i.pixbuf.width; | ||
594 | 628 | var pixbuf = i.pixbuf.scale_simple(h * scale, w * scale, Gdk.InterpType.BILINEAR); | ||
595 | 629 | i.set_from_pixbuf(pixbuf); | ||
596 | 630 | } | ||
597 | 609 | else | 631 | else |
598 | 632 | { | ||
599 | 610 | i.set_from_file (focused_filename); | 633 | i.set_from_file (focused_filename); |
600 | 634 | |||
601 | 635 | int h = i.pixbuf.height; | ||
602 | 636 | int w = i.pixbuf.width; | ||
603 | 637 | var pixbuf = i.pixbuf.scale_simple(h * scale, w * scale, Gdk.InterpType.BILINEAR); | ||
604 | 638 | i.set_from_pixbuf(pixbuf); | ||
605 | 639 | } | ||
606 | 611 | } | 640 | } |
607 | 612 | else | 641 | else |
608 | 613 | { | 642 | { |
609 | 614 | i.set_from_file (inactive_filename); | 643 | i.set_from_file (inactive_filename); |
610 | 644 | |||
611 | 645 | int h = i.pixbuf.height; | ||
612 | 646 | int w = i.pixbuf.width; | ||
613 | 647 | var pixbuf = i.pixbuf.scale_simple(h * scale, w * scale, Gdk.InterpType.BILINEAR); | ||
614 | 648 | i.set_from_pixbuf(pixbuf); | ||
615 | 615 | } | 649 | } |
616 | 616 | 650 | ||
617 | 617 | if (l != null) | 651 | if (l != null) |
This branch shows merge conflicts - should this have been proposed to lp:unity-greeter/14.04?