[gnome-control-center] online-accounts: Add a stack to the account dialog



commit 76062e1106acf481233d7adcb2d25ea2eb0c6965
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Nov 10 09:25:04 2016 -0200

    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

 panels/online-accounts/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 6529807..084a765 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 16be4b0..13f03ee 100644
--- a/panels/online-accounts/online-accounts.ui
+++ b/panels/online-accounts/online-accounts.ui
@@ -87,10 +87,35 @@
       </object>
     </child>
     <child internal-child="vbox">
-      <object class="GtkBox" id="accounts_vbox">
+      <object class="GtkBox">
         <property name="can_focus">False</property>
         <property name="orientation">vertical</property>
-        <property name="margin">18</property>
+        <child>
+          <object class="GtkStack" id="stack">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="transition_type">crossfade</property>
+            <child>
+              <object class="GtkBox" id="new_account_vbox">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="name">new-account</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox" id="accounts_vbox">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="margin">18</property>
+              </object>
+              <packing>
+                <property name="name">editor</property>
+              </packing>
+            </child>
+          </object>
+        </child>
       </object>
     </child>
   </object>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]