Merge lp:~elementary-pantheon/switchboard-plug-keyboard/add-layout-organization into lp:~elementary-pantheon/switchboard-plug-keyboard/trunk

Proposed by Danielle Foré
Status: Merged
Approved by: Danielle Foré
Approved revision: 508
Merged at revision: 512
Proposed branch: lp:~elementary-pantheon/switchboard-plug-keyboard/add-layout-organization
Merge into: lp:~elementary-pantheon/switchboard-plug-keyboard/trunk
Diff against target: 73 lines (+18/-24)
1 file modified
src/Widgets/Layout/AddLayoutPopover.vala (+18/-24)
To merge this branch: bzr merge lp:~elementary-pantheon/switchboard-plug-keyboard/add-layout-organization
Reviewer Review Type Date Requested Status
David Hewitt code, function Approve
elementary Pantheon team Pending
Review via email: mp+317044@code.launchpad.net

Commit message

AddLayoutPopover.vala:
* Put all grid properties and methods together
* Put all button_box properties and methods together
* It's not necessary to valign center labels
* Double space before button box

To post a comment you must log in.
Revision history for this message
David Hewitt (davidmhewitt) :
review: Approve (code, function)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Widgets/Layout/AddLayoutPopover.vala'
2--- src/Widgets/Layout/AddLayoutPopover.vala 2017-02-12 03:31:04 +0000
3+++ src/Widgets/Layout/AddLayoutPopover.vala 2017-02-12 04:01:06 +0000
4@@ -3,24 +3,12 @@
5
6 public AddLayout()
7 {
8- var grid = new Gtk.Grid();
9-
10- grid.margin = 12;
11- grid.column_spacing = 12;
12- grid.row_spacing = 12;
13-
14- this.add_with_properties (grid);
15-
16 // add some labels
17 var label_language = new Gtk.Label (_("Language:"));
18 var label_layout = new Gtk.Label (_("Layout:"));
19
20- label_language.valign = label_layout.valign = Gtk.Align.CENTER;
21 label_language.halign = label_layout.halign = Gtk.Align.END;
22
23- grid.attach (label_language, 0, 0, 1, 1);
24- grid.attach (label_layout, 0, 1, 1, 1);
25-
26 // list stores
27 var lang_list = create_list_store (handler.languages);
28 var language_box = new Gtk.ComboBox.with_model (lang_list);
29@@ -42,26 +30,32 @@
30 layout_box.add_attribute (renderer, "text", 1);
31 layout_box.active = 0;
32
33- grid.attach (language_box, 1, 0, 1, 1);
34- grid.attach (layout_box, 1, 1, 1, 1);
35-
36 language_box.changed.connect(() => {
37 layout_box.model = create_list_store (handler.get_variants_for_language (language_box.active_id));
38 layout_box.active = 0;
39 });
40
41- // add buttons
42- var button_box = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL);
43- button_box.layout_style = Gtk.ButtonBoxStyle.END;
44- button_box.spacing = 6;
45-
46 var button_add = new Gtk.Button.with_label (_("Add Layout"));
47 var button_cancel = new Gtk.Button.with_label (_("Cancel"));
48
49- button_box.add (button_cancel);
50- button_box.add (button_add);
51-
52- grid.attach (button_box, 0, 2, 2, 1);
53+ var button_box = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL);
54+ button_box.layout_style = Gtk.ButtonBoxStyle.END;
55+ button_box.margin_top = 12;
56+ button_box.spacing = 6;
57+ button_box.add (button_cancel);
58+ button_box.add (button_add);
59+
60+ var grid = new Gtk.Grid ();
61+ grid.column_spacing = 12;
62+ grid.row_spacing = 12;
63+ grid.margin = 12;
64+ grid.attach (label_language, 0, 0, 1, 1);
65+ grid.attach (label_layout, 0, 1, 1, 1);
66+ grid.attach (language_box, 1, 0, 1, 1);
67+ grid.attach (layout_box, 1, 1, 1, 1);
68+ grid.attach (button_box, 0, 2, 2, 1);
69+
70+ add (grid);
71
72 button_cancel.clicked.connect (() => {
73 this.hide ();

Subscribers

People subscribed via source and target branches