[nautilus] window: port GtkTable to GtkGrid



commit ac6797687cc3dc77e1fc6752090a7ef037252ade
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Oct 4 17:33:09 2011 -0400

    window: port GtkTable to GtkGrid

 src/nautilus-window-private.h |    1 -
 src/nautilus-window.c         |   28 +++++++++++-----------------
 2 files changed, 11 insertions(+), 18 deletions(-)
---
diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h
index eab9e70..dcc8e7f 100644
--- a/src/nautilus-window-private.h
+++ b/src/nautilus-window-private.h
@@ -39,7 +39,6 @@
 /* FIXME bugzilla.gnome.org 42575: Migrate more fields into here. */
 struct NautilusWindowDetails
 {
-        GtkWidget *table;
         GtkWidget *statusbar;
         GtkWidget *menubar;
         
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 39c3bf9..e67d230 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -558,7 +558,7 @@ static void
 nautilus_window_constructed (GObject *self)
 {
 	NautilusWindow *window;
-	GtkWidget *table;
+	GtkWidget *grid;
 	GtkWidget *menu;
 	GtkWidget *statusbar;
 	GtkWidget *hpaned;
@@ -572,10 +572,10 @@ nautilus_window_constructed (GObject *self)
 
 	G_OBJECT_CLASS (nautilus_window_parent_class)->constructed (self);
 
-	table = gtk_table_new (1, 6, FALSE);
-	window->details->table = table;
-	gtk_widget_show (table);
-	gtk_container_add (GTK_CONTAINER (window), table);
+	grid = gtk_grid_new ();
+	gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), GTK_ORIENTATION_VERTICAL);
+	gtk_widget_show (grid);
+	gtk_container_add (GTK_CONTAINER (window), grid);
 
 	statusbar = gtk_statusbar_new ();
 	window->details->statusbar = statusbar;
@@ -588,25 +588,19 @@ nautilus_window_constructed (GObject *self)
 
 	menu = gtk_ui_manager_get_widget (window->details->ui_manager, "/MenuBar");
 	window->details->menubar = menu;
+	gtk_widget_set_hexpand (menu, TRUE);
 	gtk_widget_show (menu);
-	gtk_table_attach (GTK_TABLE (table),
-			  menu, 
-			  /* X direction */                   /* Y direction */
-			  0, 1,                               0, 1,
-			  GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0,
-			  0,                                  0);
+	gtk_container_add (GTK_CONTAINER (grid), menu);
 
 	/* Register to menu provider extension signal managing menu updates */
 	g_signal_connect_object (nautilus_signaller_get_current (), "popup_menu_changed",
 			 G_CALLBACK (nautilus_window_load_extension_menus), window, G_CONNECT_SWAPPED);
 
 	window->details->content_paned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
-	gtk_table_attach (GTK_TABLE (window->details->table),
-			  window->details->content_paned,
-			  /* X direction */                   /* Y direction */
-			  0, 1,                               3, 4,
-			  GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_EXPAND | GTK_FILL | GTK_SHRINK,
-			  0,                                  0);
+	gtk_widget_set_hexpand (window->details->content_paned, TRUE);
+	gtk_widget_set_vexpand (window->details->content_paned, TRUE);
+
+	gtk_container_add (GTK_CONTAINER (grid), window->details->content_paned);
 	gtk_widget_show (window->details->content_paned);
 
 	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);



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