diff options
author | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-10-24 20:08:21 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-10-24 20:08:21 +0900 |
commit | fe3f948d0a6f7d628f58d0fc456b315dc1dc30be (patch) | |
tree | b8e9dc79ad5aa640e14c1a68a41e1d7e132c68dd /gtk | |
parent | 468a1d3e7c51a7b1964ccfcc680c24a04322338e (diff) | |
download | gtk+-fe3f948d0a6f7d628f58d0fc456b315dc1dc30be.tar.gz |
Implemented GtkCellLayoutIface->reorder on GtkCellAreaBox.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkcellareabox.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gtk/gtkcellareabox.c b/gtk/gtkcellareabox.c index 75e004a9db..80cb16e548 100644 --- a/gtk/gtkcellareabox.c +++ b/gtk/gtkcellareabox.c @@ -82,6 +82,9 @@ static void gtk_cell_area_box_layout_pack_start (GtkCellLayout static void gtk_cell_area_box_layout_pack_end (GtkCellLayout *cell_layout, GtkCellRenderer *renderer, gboolean expand); +static void gtk_cell_area_box_layout_reorder (GtkCellLayout *cell_layout, + GtkCellRenderer *renderer, + gint position); /* CellInfo metadata handling */ @@ -359,6 +362,7 @@ gtk_cell_area_box_cell_layout_init (GtkCellLayoutIface *iface) { iface->pack_start = gtk_cell_area_box_layout_pack_start; iface->pack_end = gtk_cell_area_box_layout_pack_end; + iface->reorder = gtk_cell_area_box_layout_reorder; } static void @@ -377,6 +381,28 @@ gtk_cell_area_box_layout_pack_end (GtkCellLayout *cell_layout, gtk_cell_area_box_pack_end (GTK_CELL_AREA_BOX (cell_layout), renderer, expand); } +static void +gtk_cell_area_box_layout_reorder (GtkCellLayout *cell_layout, + GtkCellRenderer *renderer, + gint position) +{ + GtkCellAreaBox *box = GTK_CELL_AREA_BOX (cell_layout); + GtkCellAreaBoxPrivate *priv = box->priv; + GList *node; + CellInfo *info; + + node = g_list_find_custom (priv->cells, renderer, + (GCompareFunc)cell_info_find); + + if (node) + { + info = node->data; + + priv->cells = g_list_delete_link (priv->cells, node); + priv->cells = g_list_insert (priv->cells, info, position); + } +} + /************************************************************* * API * *************************************************************/ |