diff options
author | Benjamin Otte <otte@redhat.com> | 2019-11-08 21:23:03 +0100 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-05-30 19:26:46 -0400 |
commit | efcb3a9d675378776052c8c24e625dbcabb625cd (patch) | |
tree | c247f1c5352ec780fa76547dbb3790a6b123a48b /gtk/gtkcolumnviewlayout.c | |
parent | 9f19699806879568b310b831e04db8dc35f21881 (diff) | |
download | gtk+-efcb3a9d675378776052c8c24e625dbcabb625cd.tar.gz |
columnview: Add header
This uses a custom GtkColumnViewTitle widget. So far that widget is
pretty boring, but that will change once we added
resizing, reordering, dnd, sorting, hiding/showing of columns or
whatever UIs we want.
Diffstat (limited to 'gtk/gtkcolumnviewlayout.c')
-rw-r--r-- | gtk/gtkcolumnviewlayout.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gtk/gtkcolumnviewlayout.c b/gtk/gtkcolumnviewlayout.c index 3afd6a2af3..c4ba28a112 100644 --- a/gtk/gtkcolumnviewlayout.c +++ b/gtk/gtkcolumnviewlayout.c @@ -24,6 +24,7 @@ #include "gtkcolumnviewcellprivate.h" #include "gtkcolumnviewcolumnprivate.h" #include "gtkcolumnviewprivate.h" +#include "gtkcolumnviewtitleprivate.h" #include "gtkwidgetprivate.h" struct _GtkColumnViewLayout @@ -113,10 +114,14 @@ gtk_column_view_layout_allocate (GtkLayoutManager *layout_manager, child != NULL; child = _gtk_widget_get_next_sibling (child)) { - GtkColumnViewCell *cell = GTK_COLUMN_VIEW_CELL (child); - GtkColumnViewColumn *column = gtk_column_view_cell_get_column (cell); + GtkColumnViewColumn *column; int col_x, col_width; + if (GTK_IS_COLUMN_VIEW_CELL (child)) + column = gtk_column_view_cell_get_column (GTK_COLUMN_VIEW_CELL (child)); + else + column = gtk_column_view_title_get_column (GTK_COLUMN_VIEW_TITLE (child)); + gtk_column_view_column_get_allocation (column, &col_x, &col_width); gtk_widget_size_allocate (child, &(GtkAllocation) { col_x, 0, col_width, height }, baseline); } |