Merge lp:~donadigo/pantheon-greeter/fix-time-position into lp:~elementary-pantheon/pantheon-greeter/trunk

Proposed by Adam Bieńkowski
Status: Merged
Approved by: Danielle Foré
Approved revision: 456
Merged at revision: 456
Proposed branch: lp:~donadigo/pantheon-greeter/fix-time-position
Merge into: lp:~elementary-pantheon/pantheon-greeter/trunk
Diff against target: 56 lines (+6/-5)
3 files modified
src/PantheonGreeter.vala (+4/-3)
src/TimeLabel.vala (+0/-1)
src/Wallpaper.vala (+2/-1)
To merge this branch: bzr merge lp:~donadigo/pantheon-greeter/fix-time-position
Reviewer Review Type Date Requested Status
elementary Pantheon team Pending
Review via email: mp+297332@code.launchpad.net

Commit message

* Fix the time label placement as well as fix some hardcoding in the code.

Description of the change

Fixes the time label placement as well as fixes some hardcoding in the code.

* Currently the time label placement is broken because of GTK's having it's anchor point on the middle of the widget causing the label to be in the middle of the edge of the screen.

* transition_running method was broken and caused to having loads of Gtk.Images beacause they were not removed from the stack, I replaced it with a simple timeout.

* I also replaced building the config file path with a native Path.build_filename.

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

Tested and looks good to me :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/PantheonGreeter.vala'
--- src/PantheonGreeter.vala 2016-06-13 03:48:42 +0000
+++ src/PantheonGreeter.vala 2016-06-14 12:52:34 +0000
@@ -104,7 +104,7 @@
104 104
105 settings = new KeyFile ();105 settings = new KeyFile ();
106 try {106 try {
107 settings.load_from_file (Constants.CONF_DIR+"/pantheon-greeter.conf",107 settings.load_from_file (Path.build_filename (Constants.CONF_DIR, "pantheon-greeter.conf"),
108 KeyFileFlags.KEEP_COMMENTS);108 KeyFileFlags.KEEP_COMMENTS);
109 } catch (Error e) {109 } catch (Error e) {
110 warning (e.message);110 warning (e.message);
@@ -292,12 +292,13 @@
292 } else {292 } else {
293 userlist_actor.x = 120 * ((float) (width) / NORMAL_WIDTH);293 userlist_actor.x = 120 * ((float) (width) / NORMAL_WIDTH);
294 }294 }
295
295 userlist_actor.y = Math.floorf (height / 2.0f);296 userlist_actor.y = Math.floorf (height / 2.0f);
296297
297 time.x = width - time.width - 100;298 time.x = width - time.width - time.width / 2 - 100;
298 time.y = height / 2 - time.height / 2;299 time.y = height / 2 - time.height / 2;
299300
300 time.visible = width > NO_CLOCK_WIDTH;301 time.visible = width > NO_CLOCK_WIDTH + time.width / 2;
301302
302 wallpaper.width = width;303 wallpaper.width = width;
303 wallpaper.screen_width = width;304 wallpaper.screen_width = width;
304305
=== modified file 'src/TimeLabel.vala'
--- src/TimeLabel.vala 2016-06-09 19:03:57 +0000
+++ src/TimeLabel.vala 2016-06-14 12:52:34 +0000
@@ -32,7 +32,6 @@
32 var container_widget = (Gtk.Container)this.get_widget ();32 var container_widget = (Gtk.Container)this.get_widget ();
3333
34 var layout = new Gtk.Grid ();34 var layout = new Gtk.Grid ();
35 layout.margin = 16;
3635
37 date_label = new Gtk.Label ("");36 date_label = new Gtk.Label ("");
38 date_label.get_style_context ().add_class ("h2");37 date_label.get_style_context ().add_class ("h2");
3938
=== modified file 'src/Wallpaper.vala'
--- src/Wallpaper.vala 2016-06-13 17:51:40 +0000
+++ src/Wallpaper.vala 2016-06-14 12:52:34 +0000
@@ -119,9 +119,10 @@
119 foreach (var other_wallpaper in wallpapers) {119 foreach (var other_wallpaper in wallpapers) {
120 wallpapers.remove (other_wallpaper);120 wallpapers.remove (other_wallpaper);
121121
122 stack.notify["transition_running"].connect (() => {122 Timeout.add (stack.transition_duration, () => {
123 stack.remove (other_wallpaper);123 stack.remove (other_wallpaper);
124 unused_wallpapers.push_tail (other_wallpaper);124 unused_wallpapers.push_tail (other_wallpaper);
125 return false;
125 });126 });
126 }127 }
127 wallpapers.append (new_wallpaper);128 wallpapers.append (new_wallpaper);

Subscribers

People subscribed via source and target branches