From 76062e1106acf481233d7adcb2d25ea2eb0c6965 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 10 Nov 2016 09:25:04 -0200 Subject: [PATCH] online-accounts: Add a stack to the account dialog This will be used to unify the account creation proccess and the account editor. https://bugzilla.gnome.org/show_bug.cgi?id=774222 --- .../cc-online-accounts-panel.c | 5 ++++ panels/online-accounts/online-accounts.ui | 29 +++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/panels/online-accounts/cc-online-accounts-panel.c b/panels/online-accounts/cc-online-accounts-panel.c index 652980736..084a7650b 100644 --- a/panels/online-accounts/cc-online-accounts-panel.c +++ b/panels/online-accounts/cc-online-accounts-panel.c @@ -45,6 +45,7 @@ struct _CcGoaPanel GtkWidget *edit_account_dialog; GtkWidget *edit_account_headerbar; GtkWidget *providers_listbox; + GtkWidget *stack; GtkWidget *accounts_vbox; }; @@ -344,6 +345,7 @@ cc_goa_panel_class_init (CcGoaPanelClass *klass) gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, edit_account_dialog); gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, edit_account_headerbar); gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, providers_listbox); + gtk_widget_class_bind_template_child (widget_class, CcGoaPanel, stack); gtk_widget_class_bind_template_callback (widget_class, on_edit_account_dialog_delete_event); gtk_widget_class_bind_template_callback (widget_class, on_listbox_row_activated); @@ -372,6 +374,9 @@ show_page_account (CcGoaPanel *panel, panel->active_object = object; + /* Move to the account editor page */ + gtk_stack_set_visible_child_name (GTK_STACK (panel->stack), "editor"); + /* Out with the old */ children = gtk_container_get_children (GTK_CONTAINER (panel->accounts_vbox)); for (l = children; l != NULL; l = l->next) diff --git a/panels/online-accounts/online-accounts.ui b/panels/online-accounts/online-accounts.ui index 16be4b02a..13f03ee70 100644 --- a/panels/online-accounts/online-accounts.ui +++ b/panels/online-accounts/online-accounts.ui @@ -87,10 +87,35 @@ - + False vertical - 18 + + + True + False + crossfade + + + True + False + + + new-account + + + + + True + False + 18 + + + editor + + + +