[mutter] tabpopup: Update to fix GTK+ deprecations
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] tabpopup: Update to fix GTK+ deprecations
- Date: Tue, 25 Oct 2011 13:45:01 +0000 (UTC)
commit 4b411ea2416711f90f7e1d2e58a883ade81486bd
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Oct 24 00:21:41 2011 -0400
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 files changed, 9 insertions(+), 15 deletions(-)
---
diff --git a/src/ui/tabpopup.c b/src/ui/tabpopup.c
index 8c8c23d..f6d7e6a 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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]