| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
There are various null dereference warnings in GtkListItemManager that
make the build noisy.
|
|
|
|
|
| |
Now, finally, listitemmanager has all the necessary support to make
section headers work.
|
|
|
|
|
|
|
| |
... for tracking widgets during changes.
This just pulls all the different disjointed parts into one struct with
a sensible API.
|
|
|
|
|
|
| |
This is plumbing for section handling.
The vfuncs don't do anything, this is just the infrastructure.
|
|
|
|
|
|
| |
Add a gtk_list_item_manager_set_has_sections() (default: FALSE) that
requires explicit turning on for the listitemmanager to gain section
support.
|
|
|
|
|
|
|
| |
When ensuring widgets, ensure that their section is known. This will
be relevant when we use section widgets.
Also ensure that sections that don't cover any widget get destroyed.
|
|
|
|
|
|
|
| |
... and gtk_list_tile_get_previous_skip() and use them.
Allows skipping over REMOVED and FILLER tiles which makes the code a lot
more readable.
|
| |
|
|
|
|
|
| |
We don't insert sections ourselves yet, but we handle the existing one
when items get added or removed.
|
| |
|
|
|
|
|
| |
For now, we just have a HEADER at the start and a FOOTER at the end.
That's hard enough to get right.
|
|
|
|
|
|
| |
We have a FILLER and a REMOVED type now.
Also makes gc() more sensitive to types.
|
|
|
|
| |
There's only one type for now, but hey, you have to start somewhere.
|
|
|
|
|
| |
It's a listitemwidget property, and the item manager manages the items,
not the widgets.
|
|
|
|
|
| |
It's a listitemwidget property, and the item manager manages the items,
not the widgets.
|
|
|
|
|
| |
We now have listitemmanager just create GtkListItemBase objects via
vfunc and use them.
|
|
|
|
|
|
|
| |
There's 2 reasons for this:
1. Adding a custom widget for columnview rows
2. Using this as base class for sections
|
|
|
|
| |
Use the widget instead. They're the same anyway.
|
|
|
|
| |
Remove all unused functions and an unused macro.
|
| |
|
|
|
|
|
|
|
|
|
| |
... and make the tile finding code use distance.
This also changes how gtk_list_item_manager_get_tile_at() finds the
right tile, so this is a custom commit for bisectability.
gtk_list_item_manager_get_nearest_tile() isn't used yet.
|
|
|
|
|
|
|
|
| |
That stupid space in the bottom right when n_items isn't a multiple of
n_columns needs its own tile, or we'll get errors about not finding a
tile.
So make one.
|
|
|
|
|
|
|
|
| |
Instead of making it 2 vfuncs for getting horizontal and vertical area,
make it one vfunc to get the area.
Also rewrite the implementations to use the tile's area instead of
trying to deduce things with fancy math.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of randomly changing tiles, the listitemmanager gains a split
vfunc that listview and gridview implement so they can keep their tile
areas intact. The listitemmanager will now conform to these rules:
1. Never delete a tile.
This ensures that all areas stay intact.
2. Never change the n_items of a tile other than setting them to 0.
This causes "empty" areas to appear, but listview/gridview can
easily check for them by checking for tile->n_items == 0.
gtk_list_tile_gc() will get rid of them.
3. Adding items always creates new tiles that are added with empty area.
That way they don't interrupt any existing machinery until the next
allocation.
4. Adding/removing widgets has no effect on areas
This is useful in particular when scrolling where new widgets are
moving between tiles. When the manager moves the widgets, it may
split some areas, but will not remove any existing tiles, so the
whole area stays intact and the list can deal with further scroll
events before an allocation.
This improve the situation for #3334
|
|
|
|
|
| |
Both ListView and GridView use GtkListTile now, so no need anymore for
custom machinery.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of the custom size property, use the new tile size.
Also introduce the ability to split tiles, so that gridview can split a
layout that would look like (question mark denoting cells without a
widget, which in this case would be a single tile)
█ █ █ ? ?
? ? ? ? ?
? ? ? ? ?
? ? ?
into 3 rectangular tiles like so:
█ █ █ A A
B B B B B
B B B B B
C C C
This of course also means we need to be able to merge those tiles again
when cells got added/deleted or the gridview was resized. For that job,
gtk_list_tile_gc() exists now, which removes tiles without items and
merges adjacent tiles without widgets.
|
|
|
|
| |
Use the tiles' area instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
... and use it to handle ListView allocations.
Nothing spectacular, just proof of concept.
The code introduces the idea that every tile stores its area (others
would call it "allocation", but I avoided that because tiles aren't
widgets). This should allow moving lots of code into gtklistbase.c and
not require special handling inside ListView and GridView.
And that in turn hopefully makes it easier to add more features (like
sections and so on.)
|
|
|
|
|
|
|
| |
* Instead of using a gpointer to refer to it, use the GtkListTile type.
* Use gtk_list_tile_get_foo() instead of
gtk_list_item_manager_get_tile_foo() naming.
|
|
|
|
|
| |
That's a good description for what the job of those elements is:
They're a tile in the lists scrollable area.
|
|
|
|
|
|
| |
Lars doesn't have an opinion on this problem anymore.
And when people see this warning, they should know what to do.
|
| |
|
|
|
|
| |
This might help poor static analyzers.
|
|
|
|
| |
Replace leftover gtk-doc syntax (#Type) with backquotes.
|
|
|
|
|
| |
allow-none has been deprecated for a long time
already. Instead use optional and nullable everywhere.
|
|
|
|
|
| |
Mostly fixing up indentation of continuation lines,
and other small cleanups.
|
|
|
|
|
| |
These happen for variables which are only used
in assertions, when assertions are disabled.
|
|
|
|
|
|
| |
Use the LIST and LIST_ITEM roles for GtkListView
and its children. Use the GRID and GRID_CELL roles
for GtkGridView and its children.
|
|
|
|
|
|
|
| |
Previously, we would unparent the existing item that we were about
to reuse, and not the duplicate one.
Change that.
|
|
|
|
|
|
| |
Replace a previous fix with a more correct one: Update the
selected state from the model instead of reusing the old state, the
model might have updated the selected state.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The selection model will only emit one of items-changed
or selection-changed, so when we handle an items-changed,
we must assume that selection state may have changed for
any of the newly added items.
This fixes lingering selection state in the visible range
if you change the sorting of the colors demo.
Fixes: #2827
|
|
|
|
|
|
|
| |
Add a mode to GtkListItemWidget that activates on
single click and selects on hover. Make
GtkListItemManager set this on its items
when its own 'property' of the same name is set.
|
|
|
|
|
| |
Instead of bind/rebind/update/unbind, we now just have update, and the
factories get to interpret that in the way they want.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This splits GtkListItem into 2 parts:
1. GtkListItem
This is purely a GObject with public API for developers who want to
populate lists. There is no chance to cause conflict with GtkWidget
properties that the list implementation assumed control over and
defines a clear boundary.
2. GtkListItemWidget
The widget part of the listitem. This is not only fully in control of
the list machinery, the machinery can also use different widget
implementations for different list widgets like I inted to for
GtkColumnView.
|
|
|
|
| |
Just don't call it and create empty listitems.
|
|
|
|
| |
... instead of hardcoding "row".
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make sure the APIs follow a predictable path:
setup
bind
rebind/update (0-N times)
unbind
teardown
This is the first step towards providing multiple different factories.
|
|
|
|
|
|
|
|
|
|
|
|
| |
... and replace the anchor tracking with a tracker.
Trackers track an item through the list across changes and ensure that
this item (and potentially siblings before/after it) are always backed
by a GtkListItem and that if the item gets removed a replacement gets
chosen.
This is now used for tracking the anchor but can also be used to add
trackers for the cursor later.
|
|
|
|
|
|
|
|
| |
Remove a bunch of API from the headers that isn't used anymore and then
refactor code to not call it anymore.
In particular, get rid of GtkListItemManagerChange and replace it with a
GHashTable.
|
|
|
|
|
| |
All the listview infrastructure moved with it, so the next step is
moving that back...
|