From b7f989685b937887ce1ec262fe2b9985ad9edf2b Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Mon, 8 Dec 2014 15:18:34 -0800 Subject: [PATCH] Use GtkHeaderBar for Accounts & Prefs dialogs: Bug #741240 --- .../account-dialog-account-list-pane.vala | 3 - src/client/accounts/account-dialog.vala | 11 ++-- ui/account_list.glade | 40 ++----------- ui/preferences.glade | 57 +++++-------------- 4 files changed, 23 insertions(+), 88 deletions(-) diff --git a/src/client/accounts/account-dialog-account-list-pane.vala b/src/client/accounts/account-dialog-account-list-pane.vala index 79a4eebb..0e11c06a 100644 --- a/src/client/accounts/account-dialog-account-list-pane.vala +++ b/src/client/accounts/account-dialog-account-list-pane.vala @@ -22,8 +22,6 @@ public class AccountDialogAccountListPane : AccountDialogPane { public signal void delete_account(string email_address); - public signal void close(); - public AccountDialogAccountListPane(Gtk.Stack stack) { base(stack); Gtk.Builder builder = GearyApplication.instance.create_builder("account_list.glade"); @@ -58,7 +56,6 @@ public class AccountDialogAccountListPane : AccountDialogPane { on_account_added(account); // Hook up signals. - actions.get_action("close").activate.connect(() => { close(); }); actions.get_action("add_account").activate.connect(() => { add_account(); }); edit_action.activate.connect(notify_edit_account); delete_action.activate.connect(notify_delete_account); diff --git a/src/client/accounts/account-dialog.vala b/src/client/accounts/account-dialog.vala index 192be9d4..09b7a49c 100644 --- a/src/client/accounts/account-dialog.vala +++ b/src/client/accounts/account-dialog.vala @@ -13,15 +13,19 @@ public class AccountDialog : Gtk.Dialog { private AccountDialogSpinnerPane spinner_pane; private AccountDialogRemoveConfirmPane remove_confirm_pane; private AccountDialogRemoveFailPane remove_fail_pane; + private Gtk.HeaderBar headerbar = new Gtk.HeaderBar(); public AccountDialog(Gtk.Window parent) { set_size_request(450, -1); // Sets min size. - title = _("Accounts"); + headerbar.title = _("Accounts"); + headerbar.show_close_button = true; set_transient_for(parent); set_modal(true); + set_titlebar (headerbar); get_content_area().margin_top = MARGIN; get_content_area().margin_left = MARGIN; get_content_area().margin_right = MARGIN; + get_content_area().margin_bottom = MARGIN; // Add pages to stack. account_list_pane = new AccountDialogAccountListPane(stack); @@ -31,7 +35,6 @@ public class AccountDialog : Gtk.Dialog { remove_fail_pane = new AccountDialogRemoveFailPane(stack); // Connect signals from pages. - account_list_pane.close.connect(on_close); account_list_pane.add_account.connect(on_add_account); account_list_pane.edit_account.connect(on_edit_account); account_list_pane.delete_account.connect(on_delete_account); @@ -51,10 +54,6 @@ public class AccountDialog : Gtk.Dialog { } - private void on_close() { - response(Gtk.ResponseType.CLOSE); - } - private void on_add_account() { add_edit_pane.reset_all(); add_edit_pane.set_mode(AddEditPage.PageMode.ADD); diff --git a/ui/account_list.glade b/ui/account_list.glade index 2265a77e..0cc9782e 100644 --- a/ui/account_list.glade +++ b/ui/account_list.glade @@ -1,6 +1,7 @@ + - + @@ -60,9 +61,6 @@ icons False 2 - add_account @@ -102,6 +100,9 @@ True + False @@ -109,36 +110,5 @@ 1 - - - True - False - 5 - 5 - end - - - _Close - False - close - True - False - False - True - 0.54000002145767212 - - - False - True - 0 - - - - - False - True - 2 - - diff --git a/ui/preferences.glade b/ui/preferences.glade index 2342747c..dba4eb0a 100644 --- a/ui/preferences.glade +++ b/ui/preferences.glade @@ -1,13 +1,11 @@ - + False - 5 + 12 center-on-parent dialog - False - Preferences False @@ -17,22 +15,6 @@ False end - - - _Close - True - True - True - True - True - True - - - False - True - 0 - - False @@ -52,8 +34,8 @@ 5 5 5 - 0 Reading + 0 @@ -61,8 +43,6 @@ 0 0 - 1 - 1 @@ -82,8 +62,6 @@ 0 1 - 1 - 1 @@ -103,8 +81,6 @@ 0 3 - 1 - 1 @@ -114,8 +90,8 @@ 5 5 5 - 0 Composer + 0 @@ -123,8 +99,6 @@ 0 4 - 1 - 1 @@ -144,8 +118,6 @@ 0 5 - 1 - 1 @@ -155,8 +127,8 @@ 5 5 5 - 0 Notifications + 0 @@ -164,8 +136,6 @@ 0 6 - 1 - 1 @@ -185,8 +155,6 @@ 0 7 - 1 - 1 @@ -206,8 +174,6 @@ 0 8 - 1 - 1 @@ -227,8 +193,6 @@ 0 9 - 1 - 1 @@ -243,8 +207,13 @@ - - close_button - + + + True + False + Preferences + True + +