Merge lp:~elementary-apps/screenshot-tool/save-dialog-actions into lp:~elementary-apps/screenshot-tool/trunk

Proposed by Danielle Foré
Status: Merged
Approved by: Cody Garver
Approved revision: 95
Merged at revision: 96
Proposed branch: lp:~elementary-apps/screenshot-tool/save-dialog-actions
Merge into: lp:~elementary-apps/screenshot-tool/trunk
Diff against target: 76 lines (+14/-16)
1 file modified
src/Widgets/SaveDialog.vala (+14/-16)
To merge this branch: bzr merge lp:~elementary-apps/screenshot-tool/save-dialog-actions
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+272529@code.launchpad.net

Commit message

* Use built-in action area for buttons
* Remove unnecessary Gtk.WindowPosition.CENTER
* tabs to spaces

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Widgets/SaveDialog.vala'
2--- src/Widgets/SaveDialog.vala 2015-09-25 04:13:14 +0000
3+++ src/Widgets/SaveDialog.vala 2015-09-27 16:46:49 +0000
4@@ -41,11 +41,11 @@
5
6 resizable = false;
7 deletable = false;
8+ border_width = 6;
9 modal = true;
10 set_keep_above (true);
11 set_transient_for (parent);
12- window_position = Gtk.WindowPosition.CENTER;
13-
14+
15 folder_dir = Environment.get_user_special_dir (UserDirectory.PICTURES);
16
17 if (settings.get_string ("folder-dir") != folder_dir && settings.get_string ("folder-dir") != "")
18@@ -61,11 +61,10 @@
19 date_time = new GLib.DateTime.now_local ().format ("%Y-%m-%d %H:%M:%S");
20 file_name = _("Screenshot from ") + date_time;
21
22- grid = new Gtk.Grid ();
23+ grid = new Gtk.Grid ();
24+ grid.margin = 6;
25 grid.row_spacing = 12;
26 grid.column_spacing = 12;
27- grid.margin_start = 12;
28- grid.margin_end = 12;
29
30 var content = this.get_content_area () as Gtk.Box;
31
32@@ -117,10 +116,10 @@
33
34 save_btn.get_style_context ().add_class ("suggested-action");
35
36- var box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 12);
37- box.pack_end (save_btn, false, true, 0);
38- box.pack_end (retry_btn, false, true, 0);
39- box.homogeneous = true;
40+ Gtk.Box actions = get_action_area () as Gtk.Box;
41+ actions.margin_top = 12;
42+ actions.add (retry_btn);
43+ actions.add (save_btn);
44
45 save_btn.clicked.connect (() => {
46 save_response (true, folder_dir, name_entry.get_text (), format_cmb.get_active_text ());
47@@ -132,15 +131,15 @@
48
49 format_cmb.changed.connect (() => {
50 settings.set_string ("format", format_cmb.get_active_text ());
51- });
52+ });
53
54 location.selection_changed.connect (() => {
55- SList<string> uris = location.get_uris ();
56- foreach (unowned string uri in uris) {
57- settings.set_string ("folder-dir", uri.substring (7, -1));
58+ SList<string> uris = location.get_uris ();
59+ foreach (unowned string uri in uris) {
60+ settings.set_string ("folder-dir", uri.substring (7, -1));
61 folder_dir = settings.get_string ("folder-dir");
62- }
63- });
64+ }
65+ });
66
67 key_press_event.connect ((e) => {
68 if (e.keyval == Gdk.Key.Return)
69@@ -156,7 +155,6 @@
70 grid.attach (format_cmb, 1, 2, 1, 1);
71 grid.attach (location_label, 0, 3, 1, 1);
72 grid.attach (location, 1, 3, 1, 1);
73- grid.attach (box, 1, 4, 1, 1);
74
75 content.add (grid);
76 }

Subscribers

People subscribed via source and target branches