From 4b411ea2416711f90f7e1d2e58a883ade81486bd Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 24 Oct 2011 00:21:41 -0400 Subject: [PATCH] tabpopup: Update to fix GTK+ deprecations Replace the GtkTable with a GtkGrid, replace GtkH/VBox with GtkBox https://bugzilla.gnome.org/show_bug.cgi?id=662574 --- src/ui/tabpopup.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/ui/tabpopup.c b/src/ui/tabpopup.c index 8c8c23d96..f6d7e6a6b 100644 --- a/src/ui/tabpopup.c +++ b/src/ui/tabpopup.c @@ -217,9 +217,9 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, gboolean outline) { MetaTabPopup *popup; - int i, left, right, top, bottom; + int i, left, top; int height; - GtkWidget *table; + GtkWidget *grid; GtkWidget *vbox; GtkWidget *align; GList *tmp; @@ -273,12 +273,12 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, if (i % width) height += 1; - table = gtk_table_new (height, width, FALSE); - vbox = gtk_vbox_new (FALSE, 0); + grid = gtk_grid_new (); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); - gtk_container_set_border_width (GTK_CONTAINER (table), 1); + gtk_container_set_border_width (GTK_CONTAINER (grid), 1); gtk_container_add (GTK_CONTAINER (popup->window), frame); gtk_container_add (GTK_CONTAINER (frame), @@ -289,7 +289,7 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, gtk_box_pack_start (GTK_BOX (vbox), align, TRUE, TRUE, 0); gtk_container_add (GTK_CONTAINER (align), - table); + grid); popup->label = gtk_label_new (""); @@ -306,13 +306,11 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, max_label_width = 0; top = 0; - bottom = 1; tmp = popup->entries; while (tmp && top < height) { left = 0; - right = 1; while (tmp && left < width) { @@ -351,11 +349,9 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, te->widget = image; - gtk_table_attach (GTK_TABLE (table), - te->widget, - left, right, top, bottom, - 0, 0, - 0, 0); + gtk_grid_attach (GTK_GRID (grid), + te->widget, + left, top, 1, 1); /* Efficiency rules! */ gtk_label_set_markup (GTK_LABEL (popup->label), @@ -366,11 +362,9 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, tmp = tmp->next; ++left; - ++right; } ++top; - ++bottom; } /* remove all the temporary text */