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
This commit is contained in:
Jasper St. Pierre 2011-10-24 00:21:41 -04:00
parent 70db187c36
commit 4b411ea241

View File

@ -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 */