Password dialog improvements

In addition to changes in prior three commits, this updates the
password prompt UI to closer match the new GNOME HIG.  It uses
dim-label labels and suggested-action for the OK button, whose text
is changed to "Authenticate".  It also cleans up the inter-widget
spacing, which was a bit excessive.
This commit is contained in:
Jim Nelson 2014-10-28 17:01:52 -07:00
parent 3d73c6d740
commit ad546ccd8e
2 changed files with 71 additions and 36 deletions

View file

@ -54,12 +54,7 @@ public class PasswordDialog {
if (smtp)
label_smtp.show();
Gtk.Button cancel_button = new Gtk.Button.from_stock(Stock._CANCEL);
ok_button = new Gtk.Button.from_stock(Stock._OK);
ok_button.can_default = true;
dialog.add_action_widget(cancel_button, Gtk.ResponseType.CANCEL);
dialog.add_action_widget(ok_button, Gtk.ResponseType.OK);
dialog.set_default_response(Gtk.ResponseType.OK);
ok_button = (Gtk.Button) builder.get_object("authenticate_button");
refresh_ok_button_sensitivity();
entry_password.changed.connect(refresh_ok_button_sensitivity);

View file

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.0 on Thu Dec 19 17:05:59 2013 -->
<!-- Generated with glade 3.16.1 -->
<interface>
<!-- interface-requires gtk+ 3.0 -->
<requires lib="gtk+" version="3.10"/>
<object class="GtkDialog" id="PasswordDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="type_hint">dialog</property>
<property name="has_resize_grip">False</property>
<child internal-child="vbox">
@ -49,6 +50,8 @@
<property name="yalign">0</property>
<property name="label">(set in password-dialog.vala)</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
<property name="wrap_mode">word-char</property>
</object>
<packing>
<property name="expand">False</property>
@ -61,11 +64,12 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkLabel" id="label: smtp">
<property name="visible">False</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="margin_bottom">4</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">SMTP Credentials</property>
<attributes>
@ -83,9 +87,11 @@
<object class="GtkLabel" id="label for: username">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="xpad">6</property>
<property name="label" translatable="yes">Username:</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Username</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
@ -98,9 +104,11 @@
<object class="GtkLabel" id="label for: password">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="xpad">6</property>
<property name="label" translatable="yes">Password:</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Password</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
@ -114,7 +122,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="xpad">2</property>
<property name="label">(set in password-dialog.vala)</property>
</object>
<packing>
<property name="left_attach">1</property>
@ -139,6 +147,24 @@
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="check: remember_password">
<property name="label" translatable="yes">_Remember password</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">end</property>
<property name="use_underline">True</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">2</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
@ -146,23 +172,6 @@
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="check: remember_password">
<property name="label" translatable="yes">_Remember password</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">end</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
@ -180,12 +189,39 @@
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="valign">end</property>
<property name="layout_style">end</property>
<child>
<placeholder/>
<object class="GtkButton" id="cancel_button">
<property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
<object class="GtkButton" id="authenticate_button">
<property name="label" translatable="yes">_Authenticate</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<style>
<class name="suggested-action"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
@ -197,5 +233,9 @@
</child>
</object>
</child>
<action-widgets>
<action-widget response="-6">cancel_button</action-widget>
<action-widget response="-5">authenticate_button</action-widget>
</action-widgets>
</object>
</interface>