[gnome-online-accounts] exchange: Ensure that the width of the refresh dialog is correct



commit af6aef23a10cf6fef2227841a0600b6848469615
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Feb 15 13:14:05 2013 +0100

    exchange: Ensure that the width of the refresh dialog is correct

 src/goabackend/goaexchangeprovider.c |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/src/goabackend/goaexchangeprovider.c b/src/goabackend/goaexchangeprovider.c
index 4118f0f..8c9dd2f 100644
--- a/src/goabackend/goaexchangeprovider.c
+++ b/src/goabackend/goaexchangeprovider.c
@@ -556,8 +556,25 @@ create_account_details_ui (GoaProvider    *provider,
   gtk_widget_show (label);
   gtk_container_add (GTK_CONTAINER (data->progress_grid), label);
 
-  gtk_window_get_size (GTK_WINDOW (data->dialog), &width, NULL);
-  gtk_widget_set_size_request (GTK_WIDGET (data->dialog), width, -1);
+  if (new_account)
+    {
+      gtk_window_get_size (GTK_WINDOW (data->dialog), &width, NULL);
+      gtk_widget_set_size_request (GTK_WIDGET (data->dialog), width, -1);
+    }
+  else
+    {
+      GtkWindow *parent;
+
+      /* Keep in sync with GoaPanelAddAccountDialog in
+       * gnome-control-center.
+       */
+      parent = gtk_window_get_transient_for (GTK_WINDOW (data->dialog));
+      if (parent != NULL)
+        {
+          gtk_window_get_size (parent, &width, NULL);
+          gtk_widget_set_size_request (GTK_WIDGET (data->dialog), (gint) (0.5 * width), -1);
+        }
+    }
 }
 
 /* ---------------------------------------------------------------------------------------------------- */


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