Merge lp:~elementary-pantheon/switchboard-plug-onlineaccounts/style-native-view into lp:~elementary-apps/switchboard-plug-onlineaccounts/trunk

Proposed by Danielle Foré
Status: Merged
Approved by: Corentin Noël
Approved revision: 288
Merged at revision: 288
Proposed branch: lp:~elementary-pantheon/switchboard-plug-onlineaccounts/style-native-view
Merge into: lp:~elementary-apps/switchboard-plug-onlineaccounts/trunk
Diff against target: 88 lines (+18/-21)
1 file modified
src/Authentification/GraphicalDialog.vala (+18/-21)
To merge this branch: bzr merge lp:~elementary-pantheon/switchboard-plug-onlineaccounts/style-native-view
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+294944@code.launchpad.net

Commit message

GraphicalDialog.vala:
* Use Cancel button in buttonbox instead of infobar
* Set suggested action class
* Change button text from "Save" to "Log In"
* Properly center grid contents
* Better align widgets

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/Authentification/GraphicalDialog.vala'
2--- src/Authentification/GraphicalDialog.vala 2015-08-20 12:36:32 +0000
3+++ src/Authentification/GraphicalDialog.vala 2016-05-17 17:42:48 +0000
4@@ -27,6 +27,7 @@
5 Gtk.Entry new_password_entry;
6 Gtk.Entry confirm_password_entry;
7 Gtk.Entry captcha_entry;
8+ Gtk.Button cancel_button;
9 Gtk.Button save_button;
10 Gtk.CheckButton remember_button;
11 Gtk.LinkButton forgot_button;
12@@ -49,32 +50,19 @@
13 public GraphicalDialog (GLib.HashTable<string, GLib.Variant> params) {
14 base (params);
15
16+ halign = Gtk.Align.CENTER;
17+ valign = Gtk.Align.CENTER;
18 column_spacing = 12;
19 row_spacing = 6;
20
21- var infobar = new Gtk.InfoBar.with_buttons (_("Cancel"), 0);
22- var container = infobar.get_content_area () as Gtk.Container;
23- var info_label = new Gtk.Label (_("Please enter your credentials…"));
24- info_label.valign = Gtk.Align.CENTER;
25- container.add (info_label);
26- infobar.response.connect (() => {
27- error_code = GSignond.SignonuiError.CANCELED;
28- finished ();
29- this.destroy ();
30- });
31-
32- var fake_grid_left = new Gtk.Grid ();
33- fake_grid_left.hexpand = true;
34- var fake_grid_right = new Gtk.Grid ();
35- fake_grid_right.hexpand = true;
36- attach (fake_grid_left, 0, 1, 1, 1);
37- attach (fake_grid_right, 3, 1, 1, 1);
38-
39 var username_label = new Gtk.Label (_("Username:"));
40+ username_label.halign = Gtk.Align.END;
41 username_entry = new Gtk.Entry ();
42 username_entry.placeholder_text = _("john_doe");
43+ username_entry.width_request = 256;
44
45 var password_label = new Gtk.Label (_("Password:"));
46+ password_label.halign = Gtk.Align.END;
47 password_entry = new Gtk.Entry ();
48 password_entry.visibility = false;
49 password_entry.input_purpose = Gtk.InputPurpose.PASSWORD;
50@@ -100,7 +88,9 @@
51 message_label = new Gtk.Label ("");
52 message_label.no_show_all = true;
53
54- save_button = new Gtk.Button.with_label (_("Save"));
55+ cancel_button = new Gtk.Button.with_label (_("Cancel"));
56+ save_button = new Gtk.Button.with_label (_("Log In"));
57+ save_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION);
58
59 set_parameters (params);
60
61@@ -112,7 +102,7 @@
62 if (query_password == true) {
63 attach (password_label, 1, 2, 1, 1);
64 attach (password_entry, 2, 2, 1, 1);
65- attach (remember_button, 1, 5, 2, 1);
66+ attach (remember_button, 2, 5, 1, 1);
67 }
68
69 if (forgot_password_url != null) {
70@@ -133,10 +123,17 @@
71
72 attach (message_label, 1, 9, 2, 1);
73 Gtk.ButtonBox save_box = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL);
74+ save_box.margin_top = 12;
75+ save_box.spacing = 6;
76 save_box.set_layout (Gtk.ButtonBoxStyle.END);
77+ save_box.add (cancel_button);
78 save_box.add (save_button);
79 save_button.clicked.connect (() => finished ());
80- attach (infobar, 0, 0, 4, 1);
81+ cancel_button.clicked.connect (() => {
82+ error_code = GSignond.SignonuiError.CANCELED;
83+ finished ();
84+ this.destroy ();
85+ });
86 attach (save_box, 1, 10, 2, 1);
87 show_all ();
88 }

Subscribers

People subscribed via source and target branches