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
1=== modified file 'src/PantheonGreeter.vala'
2--- src/PantheonGreeter.vala 2016-06-13 03:48:42 +0000
3+++ src/PantheonGreeter.vala 2016-06-14 12:52:34 +0000
4@@ -104,7 +104,7 @@
5
6 settings = new KeyFile ();
7 try {
8- settings.load_from_file (Constants.CONF_DIR+"/pantheon-greeter.conf",
9+ settings.load_from_file (Path.build_filename (Constants.CONF_DIR, "pantheon-greeter.conf"),
10 KeyFileFlags.KEEP_COMMENTS);
11 } catch (Error e) {
12 warning (e.message);
13@@ -292,12 +292,13 @@
14 } else {
15 userlist_actor.x = 120 * ((float) (width) / NORMAL_WIDTH);
16 }
17+
18 userlist_actor.y = Math.floorf (height / 2.0f);
19
20- time.x = width - time.width - 100;
21+ time.x = width - time.width - time.width / 2 - 100;
22 time.y = height / 2 - time.height / 2;
23
24- time.visible = width > NO_CLOCK_WIDTH;
25+ time.visible = width > NO_CLOCK_WIDTH + time.width / 2;
26
27 wallpaper.width = width;
28 wallpaper.screen_width = width;
29
30=== modified file 'src/TimeLabel.vala'
31--- src/TimeLabel.vala 2016-06-09 19:03:57 +0000
32+++ src/TimeLabel.vala 2016-06-14 12:52:34 +0000
33@@ -32,7 +32,6 @@
34 var container_widget = (Gtk.Container)this.get_widget ();
35
36 var layout = new Gtk.Grid ();
37- layout.margin = 16;
38
39 date_label = new Gtk.Label ("");
40 date_label.get_style_context ().add_class ("h2");
41
42=== modified file 'src/Wallpaper.vala'
43--- src/Wallpaper.vala 2016-06-13 17:51:40 +0000
44+++ src/Wallpaper.vala 2016-06-14 12:52:34 +0000
45@@ -119,9 +119,10 @@
46 foreach (var other_wallpaper in wallpapers) {
47 wallpapers.remove (other_wallpaper);
48
49- stack.notify["transition_running"].connect (() => {
50+ Timeout.add (stack.transition_duration, () => {
51 stack.remove (other_wallpaper);
52 unused_wallpapers.push_tail (other_wallpaper);
53+ return false;
54 });
55 }
56 wallpapers.append (new_wallpaper);

Subscribers

People subscribed via source and target branches