Commit Graph

7 Commits

Author SHA1 Message Date
Matthias Clasen
f6da324670 columnview: Split gtk_column_view_allocate_columns
Split off a helper function that just distributes
the widths, without actually allocating the columns.

This will be used in measuring in the future.
2020-06-05 11:27:40 -04:00
Matthias Clasen
aa2d339508 columnview: Add a helper
The column code needs to get access to the
listitem widgets that are children of the listview,
so add a getter.
2020-06-03 12:48:56 -04:00
Matthias Clasen
66500a6882 columnview: Add sorting
This is a somewhat large commit that:

- Adds GtkColumnViewSorter
This is a special-purpose, private sorter implementation which sorts
according to multiple sorters, allowing each individual sorter to be
inverted. This will be used with clickable column view headers.

- Adds a read-only GtkColumnView::sorter property
The GtkColumnView creates a GtkColumnViewSorter at startup that it uses
for this property.

- Adds a writable GtkColumnViewColumn::sorter property
This allows defining per-column sorters. Whenever an application sets a
sorter for a column, the header becomes clickable and whenever
a header is clicked, that column's sorter is prepended to the list of
sorters, unless it is already the first sorter, in which case we invert
its order. No column can be in the list more than once.
2020-05-30 19:26:46 -04:00
Benjamin Otte
efcb3a9d67 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.
2020-05-30 19:26:46 -04:00
Benjamin Otte
326cb1148b columnview: Add a custom LayoutManager
The ColumnView now allocates column widths first and then the individual
rows use the new layout manager which looks at the column allocations to
allocate their children.
2020-05-30 19:26:46 -04:00
Benjamin Otte
9927d9bda2 columnview: Add GtkColumnViewCell
It's a GtkListItemWidget subclass that tracks the column it belongs to
and allows the column to track it.

We also use this subclass to implement sizing support so columns share
the same size and get resized in sync.
2020-05-30 19:26:46 -04:00
Benjamin Otte
8736343544 columnview: Add listitems for the columns
They are not aligned in columns yet, but they do exist.
2020-05-30 19:26:46 -04:00