[gnome-control-center] online-accounts: Always keep editor dialog size the minimum



commit 1f1f2e2b1fe574ba955923203225e158fb60ce9c
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Feb 16 09:57:56 2017 -0200

    online-accounts: Always keep editor dialog size the minimum
    
    When adding and editing accounts, the different options that Online
    Accounts provides may require different sizes of the dialog. There is,
    however, a specific issue where the dialog can't resize because a
    provider widget is interefering with the others.
    
    Fix that by making the dialog's stack non-homogeneous, and making sure
    to always reset the dialog size before showing it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774222

 panels/online-accounts/cc-online-accounts-panel.c |    6 ++++++
 panels/online-accounts/online-accounts.ui         |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/panels/online-accounts/cc-online-accounts-panel.c 
b/panels/online-accounts/cc-online-accounts-panel.c
index 5db96e1..2c70b6c 100644
--- a/panels/online-accounts/cc-online-accounts-panel.c
+++ b/panels/online-accounts/cc-online-accounts-panel.c
@@ -186,6 +186,9 @@ on_provider_row_activated (CcGoaPanel    *self,
   /* Move to the new account page */
   gtk_stack_set_visible_child_name (GTK_STACK (self->stack), "new-account");
 
+  /* Reset the dialog size */
+  gtk_window_resize (GTK_WINDOW (self->edit_account_dialog), 1, 1);
+
   /* This spins gtk_dialog_run() */
   object = goa_provider_add_account (provider,
                                      self->client,
@@ -494,6 +497,9 @@ show_page_account (CcGoaPanel  *panel,
   gtk_header_bar_set_title (GTK_HEADER_BAR (panel->edit_account_headerbar), title);
   g_free (title);
 
+  /* Reset the dialog size */
+  gtk_window_resize (GTK_WINDOW (panel->edit_account_dialog), 1, 1);
+
   gtk_widget_show_all (panel->accounts_vbox);
   gtk_widget_show (panel->edit_account_dialog);
 
diff --git a/panels/online-accounts/online-accounts.ui b/panels/online-accounts/online-accounts.ui
index f632e55..7022ca3 100644
--- a/panels/online-accounts/online-accounts.ui
+++ b/panels/online-accounts/online-accounts.ui
@@ -162,6 +162,7 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="transition_type">crossfade</property>
+            <property name="homogeneous">False</property>
             <child>
               <object class="GtkBox" id="new_account_vbox">
                 <property name="visible">True</property>


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