[gtranslator] Load layout after the tab is realized.



commit 66db3258902ef4a2fa475e995b6029da10c510b0
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Tue May 3 17:53:33 2011 +0200

    Load layout after the tab is realized.
    
    Currently there is a bug in gdl that places the widgets
    whenever it wants if they are added after the layout is loaded
    so this makes the widgets more or less well placed.

 src/gtr-tab.c |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/src/gtr-tab.c b/src/gtr-tab.c
index 9b245c0..0af4890 100644
--- a/src/gtr-tab.c
+++ b/src/gtr-tab.c
@@ -687,7 +687,6 @@ gtr_tab_draw (GtrTab *tab)
   GtkWidget *scroll;
   GtkWidget *dockbar;
   GtrTabPrivate *priv = tab->priv;
-  gchar *filename;
 
   /* Docker */
   hbox = gtk_hbox_new (FALSE, 0);
@@ -828,13 +827,6 @@ gtr_tab_draw (GtrTab *tab)
                       NULL,
                       GTR_TAB_PLACEMENT_RIGHT,
                       FALSE);
-
-  /* Loading dock layout */
-  filename = g_build_filename (gtr_dirs_get_user_config_dir (),
-                               "gtr-layout.xml", NULL);
-
-  gtr_tab_layout_load (tab, filename, NULL);
-  g_free (filename);
 }
 
 static void
@@ -1003,15 +995,25 @@ gtr_tab_realize (GtkWidget *widget)
 {
   GtrTab *tab = GTR_TAB (widget);
 
+  GTK_WIDGET_CLASS (gtr_tab_parent_class)->realize (widget);
+
   if (!tab->priv->tab_realized)
     {
+      gchar *filename;
+
       /* We only activate the extensions when the tab is realized,
        * because most plugins will expect this behaviour. */
       peas_extension_set_call (tab->priv->extensions, "activate");
+
+      /* Loading dock layout */
+      filename = g_build_filename (gtr_dirs_get_user_config_dir (),
+                                   "gtr-layout.xml", NULL);
+
+      gtr_tab_layout_load (tab, filename, NULL);
+      g_free (filename);
+
       tab->priv->tab_realized = TRUE;
     }
-
-  GTK_WIDGET_CLASS (gtr_tab_parent_class)->realize (widget);
 }
 
 static void



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