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
=== modified file 'lib/Widgets/AlertView.vala'
--- lib/Widgets/AlertView.vala 2015-10-19 19:26:00 +0000
+++ lib/Widgets/AlertView.vala 2016-05-04 02:04:33 +0000
@@ -85,25 +85,21 @@
8585
86 construct {86 construct {
87 get_style_context ().add_class (Gtk.STYLE_CLASS_VIEW);87 get_style_context ().add_class (Gtk.STYLE_CLASS_VIEW);
88 row_spacing = 12;
89 column_spacing = 12;
9088
91 title_label = new Gtk.Label (null);89 title_label = new Gtk.Label (null);
92 title_label.hexpand = true;90 title_label.hexpand = true;
93 title_label.get_style_context ().add_class ("h2");91 title_label.get_style_context ().add_class ("h2");
94 title_label.halign = Gtk.Align.START;92 title_label.xalign = 0;
95 title_label.valign = Gtk.Align.START;
9693
97 description_label = new Gtk.Label (null);94 description_label = new Gtk.Label (null);
98 description_label.hexpand = true;95 description_label.hexpand = true;
99 description_label.wrap = true;96 description_label.wrap = true;
100 description_label.justify = Gtk.Justification.FILL;
101 description_label.use_markup = true;97 description_label.use_markup = true;
102 description_label.halign = Gtk.Align.START;98 description_label.xalign = 0;
103 description_label.valign = Gtk.Align.START;99 description_label.valign = Gtk.Align.START;
104100
105 action_button = new Gtk.Button ();101 action_button = new Gtk.Button ();
106 action_button.margin_top = 12;102 action_button.margin_top = 24;
107103
108 action_revealer = new Gtk.Revealer ();104 action_revealer = new Gtk.Revealer ();
109 action_revealer.add (action_button);105 action_revealer.add (action_button);
@@ -112,22 +108,24 @@
112108
113 image = new Gtk.Image ();109 image = new Gtk.Image ();
114 var image_box = new Gtk.EventBox ();110 var image_box = new Gtk.EventBox ();
111 image_box.margin_top = 6;
115 image_box.valign = Gtk.Align.START;112 image_box.valign = Gtk.Align.START;
116 image_box.add (image);113 image_box.add (image);
117114
118 attach (image_box, 1, 1, 1, 2);115 var layout = new Gtk.Grid ();
119 attach (title_label, 2, 1, 1, 1);116 layout.column_spacing = 12;
120 attach (description_label, 2, 2, 1, 1);117 layout.row_spacing = 6;
121 attach (action_revealer, 2, 3, 1, 1);118 layout.halign = Gtk.Align.CENTER;
122119 layout.valign = Gtk.Align.CENTER;
123 // Needed to center the text and image in the window.120 layout.vexpand = true;
124 var left_grid = new Gtk.Grid ();121 layout.margin = 24;
125 left_grid.expand = true;122
126 attach (left_grid, 0, 0, 1, 1);123 layout.attach (image_box, 1, 1, 1, 2);
127124 layout.attach (title_label, 2, 1, 1, 1);
128 var right_grid = new Gtk.Grid ();125 layout.attach (description_label, 2, 2, 1, 1);
129 right_grid.expand = true;126 layout.attach (action_revealer, 2, 3, 1, 1);
130 attach (right_grid, 3, 4, 1, 1);127
128 add (layout);
131129
132 action_button.clicked.connect (() => {action_activated ();});130 action_button.clicked.connect (() => {action_activated ();});
133 }131 }

Subscribers

People subscribed via source and target branches