summaryrefslogtreecommitdiff
path: root/gtk/gtkcolumnviewcolumn.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-06-05 12:39:48 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-06-05 13:28:44 -0400
commit6df489d5a9d613efdb2c02b648302abe67133691 (patch)
tree0e14beff4411d18ab19b466c2b6921f8fafbc329 /gtk/gtkcolumnviewcolumn.c
parent15c6ad88c09f63c737c45254f5d544c1f2114d22 (diff)
downloadgtk+-6df489d5a9d613efdb2c02b648302abe67133691.tar.gz
columnviewcolumn: Add private api to set the position
This is needed to make columns reorder their cells when their position in the column views list of columns changes.
Diffstat (limited to 'gtk/gtkcolumnviewcolumn.c')
-rw-r--r--gtk/gtkcolumnviewcolumn.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk/gtkcolumnviewcolumn.c b/gtk/gtkcolumnviewcolumn.c
index 0567931905..dd8a4cd3a4 100644
--- a/gtk/gtkcolumnviewcolumn.c
+++ b/gtk/gtkcolumnviewcolumn.c
@@ -625,6 +625,25 @@ gtk_column_view_column_set_column_view (GtkColumnViewColumn *self,
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_COLUMN_VIEW]);
}
+void
+gtk_column_view_column_set_position (GtkColumnViewColumn *self,
+ guint position)
+{
+ GtkColumnViewCell *cell;
+
+ gtk_list_item_widget_reorder_child (gtk_column_view_get_header_widget (self->view),
+ self->header,
+ position);
+
+ for (cell = self->first_cell; cell; cell = gtk_column_view_cell_get_next (cell))
+ {
+ GtkListItemWidget *list_item;
+
+ list_item = GTK_LIST_ITEM_WIDGET (gtk_widget_get_parent (GTK_WIDGET (cell)));
+ gtk_list_item_widget_reorder_child (list_item, GTK_WIDGET (cell), position);
+ }
+}
+
/**
* gtk_column_view_column_get_factory:
* @self: a #GtkColumnViewColumn