Merge lp:~elementary-apps/granite/fix-alertview into lp:~elementary-pantheon/granite/granite

Proposed by Danielle Foré
Status: Merged
Approved by: Danielle Foré
Approved revision: 942
Merged at revision: 941
Proposed branch: lp:~elementary-apps/granite/fix-alertview
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 70 lines (+18/-20)
1 file modified
lib/Widgets/AlertView.vala (+18/-20)
To merge this branch: bzr merge lp:~elementary-apps/granite/fix-alertview
Reviewer Review Type Date Requested Status
Sam Thomas (community) Approve
elementary Pantheon team Pending
Review via email: mp+293699@code.launchpad.net

Commit message

AlertView:
* Center properly
* Fix text alignment and justification
* Adjust icon alignment
* Adjust vertical spacing between elements
* Add margin

To post a comment you must log in.
942. By Danielle Foré

cut out an extra line

Revision history for this message
Sam Thomas (sgpthomas) wrote :

Looks good to me!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/Widgets/AlertView.vala'
2--- lib/Widgets/AlertView.vala 2015-10-19 19:26:00 +0000
3+++ lib/Widgets/AlertView.vala 2016-05-04 02:04:33 +0000
4@@ -85,25 +85,21 @@
5
6 construct {
7 get_style_context ().add_class (Gtk.STYLE_CLASS_VIEW);
8- row_spacing = 12;
9- column_spacing = 12;
10
11 title_label = new Gtk.Label (null);
12 title_label.hexpand = true;
13 title_label.get_style_context ().add_class ("h2");
14- title_label.halign = Gtk.Align.START;
15- title_label.valign = Gtk.Align.START;
16+ title_label.xalign = 0;
17
18 description_label = new Gtk.Label (null);
19 description_label.hexpand = true;
20 description_label.wrap = true;
21- description_label.justify = Gtk.Justification.FILL;
22 description_label.use_markup = true;
23- description_label.halign = Gtk.Align.START;
24+ description_label.xalign = 0;
25 description_label.valign = Gtk.Align.START;
26
27 action_button = new Gtk.Button ();
28- action_button.margin_top = 12;
29+ action_button.margin_top = 24;
30
31 action_revealer = new Gtk.Revealer ();
32 action_revealer.add (action_button);
33@@ -112,22 +108,24 @@
34
35 image = new Gtk.Image ();
36 var image_box = new Gtk.EventBox ();
37+ image_box.margin_top = 6;
38 image_box.valign = Gtk.Align.START;
39 image_box.add (image);
40
41- attach (image_box, 1, 1, 1, 2);
42- attach (title_label, 2, 1, 1, 1);
43- attach (description_label, 2, 2, 1, 1);
44- attach (action_revealer, 2, 3, 1, 1);
45-
46- // Needed to center the text and image in the window.
47- var left_grid = new Gtk.Grid ();
48- left_grid.expand = true;
49- attach (left_grid, 0, 0, 1, 1);
50-
51- var right_grid = new Gtk.Grid ();
52- right_grid.expand = true;
53- attach (right_grid, 3, 4, 1, 1);
54+ var layout = new Gtk.Grid ();
55+ layout.column_spacing = 12;
56+ layout.row_spacing = 6;
57+ layout.halign = Gtk.Align.CENTER;
58+ layout.valign = Gtk.Align.CENTER;
59+ layout.vexpand = true;
60+ layout.margin = 24;
61+
62+ layout.attach (image_box, 1, 1, 1, 2);
63+ layout.attach (title_label, 2, 1, 1, 1);
64+ layout.attach (description_label, 2, 2, 1, 1);
65+ layout.attach (action_revealer, 2, 3, 1, 1);
66+
67+ add (layout);
68
69 action_button.clicked.connect (() => {action_activated ();});
70 }

Subscribers

People subscribed via source and target branches