diff options
| author | Matthias Clasen <mclasen@redhat.com> | 2019-12-20 17:19:55 -0500 |
|---|---|---|
| committer | Matthias Clasen <mclasen@redhat.com> | 2020-05-30 20:01:14 -0400 |
| commit | d5ce5b53d65bf7fb60f86948c9d08a359488c594 (patch) | |
| tree | 5c637704a28faae0593bf2ea7e1058537abd0c28 | |
| parent | 915bdf24a7a8c1c65f36bec9a85156fc3b679985 (diff) | |
| download | gtk+-d5ce5b53d65bf7fb60f86948c9d08a359488c594.tar.gz | |
columnviewcolumn: Add reordering helpers
Add helper functions that let us temporarily give
a different allocation to headers. These will be
used to implement interactive column reordering
in GtkColumnView.
| -rw-r--r-- | gtk/gtkcolumnviewcolumn.c | 21 | ||||
| -rw-r--r-- | gtk/gtkcolumnviewcolumnprivate.h | 6 |
2 files changed, 27 insertions, 0 deletions
diff --git a/gtk/gtkcolumnviewcolumn.c b/gtk/gtkcolumnviewcolumn.c index 785bb575e1..2e9dc31a4f 100644 --- a/gtk/gtkcolumnviewcolumn.c +++ b/gtk/gtkcolumnviewcolumn.c @@ -60,6 +60,7 @@ struct _GtkColumnViewColumn int natural_size_request; int allocation_offset; int allocation_size; + int header_position; int fixed_width; @@ -453,6 +454,7 @@ gtk_column_view_column_allocate (GtkColumnViewColumn *self, { self->allocation_offset = offset; self->allocation_size = size; + self->header_position = offset; } void @@ -880,3 +882,22 @@ gtk_column_view_column_get_header (GtkColumnViewColumn *self) { return self->header; } + +void +gtk_column_view_column_set_header_position (GtkColumnViewColumn *self, + int offset) +{ + self->header_position = offset; +} + +void +gtk_column_view_column_get_header_allocation (GtkColumnViewColumn *self, + int *offset, + int *size) +{ + if (offset) + *offset = self->header_position; + + if (size) + *size = self->allocation_size; +} diff --git a/gtk/gtkcolumnviewcolumnprivate.h b/gtk/gtkcolumnviewcolumnprivate.h index 925343f998..2fa9afa989 100644 --- a/gtk/gtkcolumnviewcolumnprivate.h +++ b/gtk/gtkcolumnviewcolumnprivate.h @@ -48,4 +48,10 @@ void gtk_column_view_column_get_allocation (GtkColu void gtk_column_view_column_notify_sort (GtkColumnViewColumn *self); +void gtk_column_view_column_set_header_position (GtkColumnViewColumn *self, + int offset); +void gtk_column_view_column_get_header_allocation (GtkColumnViewColumn *self, + int *offset, + int *size); + #endif /* __GTK_COLUMN_VIEW_COLUMN_PRIVATE_H__ */ |
