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:
parent
70db187c36
commit
4b411ea241
@ -217,9 +217,9 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
|
|||||||
gboolean outline)
|
gboolean outline)
|
||||||
{
|
{
|
||||||
MetaTabPopup *popup;
|
MetaTabPopup *popup;
|
||||||
int i, left, right, top, bottom;
|
int i, left, top;
|
||||||
int height;
|
int height;
|
||||||
GtkWidget *table;
|
GtkWidget *grid;
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
GtkWidget *align;
|
GtkWidget *align;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
@ -273,12 +273,12 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
|
|||||||
if (i % width)
|
if (i % width)
|
||||||
height += 1;
|
height += 1;
|
||||||
|
|
||||||
table = gtk_table_new (height, width, FALSE);
|
grid = gtk_grid_new ();
|
||||||
vbox = gtk_vbox_new (FALSE, 0);
|
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||||
|
|
||||||
frame = gtk_frame_new (NULL);
|
frame = gtk_frame_new (NULL);
|
||||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
|
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),
|
gtk_container_add (GTK_CONTAINER (popup->window),
|
||||||
frame);
|
frame);
|
||||||
gtk_container_add (GTK_CONTAINER (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_box_pack_start (GTK_BOX (vbox), align, TRUE, TRUE, 0);
|
||||||
|
|
||||||
gtk_container_add (GTK_CONTAINER (align),
|
gtk_container_add (GTK_CONTAINER (align),
|
||||||
table);
|
grid);
|
||||||
|
|
||||||
popup->label = gtk_label_new ("");
|
popup->label = gtk_label_new ("");
|
||||||
|
|
||||||
@ -306,13 +306,11 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
|
|||||||
|
|
||||||
max_label_width = 0;
|
max_label_width = 0;
|
||||||
top = 0;
|
top = 0;
|
||||||
bottom = 1;
|
|
||||||
tmp = popup->entries;
|
tmp = popup->entries;
|
||||||
|
|
||||||
while (tmp && top < height)
|
while (tmp && top < height)
|
||||||
{
|
{
|
||||||
left = 0;
|
left = 0;
|
||||||
right = 1;
|
|
||||||
|
|
||||||
while (tmp && left < width)
|
while (tmp && left < width)
|
||||||
{
|
{
|
||||||
@ -351,11 +349,9 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
|
|||||||
|
|
||||||
te->widget = image;
|
te->widget = image;
|
||||||
|
|
||||||
gtk_table_attach (GTK_TABLE (table),
|
gtk_grid_attach (GTK_GRID (grid),
|
||||||
te->widget,
|
te->widget,
|
||||||
left, right, top, bottom,
|
left, top, 1, 1);
|
||||||
0, 0,
|
|
||||||
0, 0);
|
|
||||||
|
|
||||||
/* Efficiency rules! */
|
/* Efficiency rules! */
|
||||||
gtk_label_set_markup (GTK_LABEL (popup->label),
|
gtk_label_set_markup (GTK_LABEL (popup->label),
|
||||||
@ -366,11 +362,9 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
|
|||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
|
|
||||||
++left;
|
++left;
|
||||||
++right;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
++top;
|
++top;
|
||||||
++bottom;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove all the temporary text */
|
/* remove all the temporary text */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user