Commit Graph

59973 Commits

Author SHA1 Message Date
Matthias Clasen
d080a2c482 gtk-demo: Plug memory leaks in the settings demo 2019-12-25 01:10:48 -05:00
Matthias Clasen
682dbe1c9c inspector: Use search instead of filtering for properties
This is mainly to test the search support.
2019-12-24 20:09:48 -05:00
Matthias Clasen
3f5d6bd8b5 listbase: search support
Add a filter to GtkListBase, and move the selection
to the first matching item whenever the filter changes.
This is meant to be used with single selection and
a string filter that is hooked up to a search entry.
2019-12-24 20:09:01 -05:00
Matthias Clasen
98aedb7592 inspector: Add columns to the object tree
Add columnview columns in the object tree.
We do the same for treeview columns.
2019-12-24 15:36:08 -05:00
Matthias Clasen
b1fdd77ede builderlistitemfactory: Precompile the xml
This is the one place where we can really take advantage
of precompiling, since we instantiate this template
over and over.
2019-12-24 15:36:08 -05:00
Matthias Clasen
ed7f507206 builder: Avoid a crash in error cases
Don't leave a dangling pointer behind. I've hit
cases where we crash trying to free it again.
2019-12-24 15:36:08 -05:00
Matthias Clasen
a101e8079f builder: Avoid another critical
Only free an expression if we managed
to create one.
2019-12-24 15:36:08 -05:00
Matthias Clasen
b8faadec64 builder: Avoid a critical
Check that the property exists before trying
to create a property expression, and report
an error if it doesn't.
2019-12-24 15:36:08 -05:00
Matthias Clasen
51b4768fd7 expression: Add a new property expression constructor
Allow creating property expresions from a GParamSpec.
This lets us avoid a critical, and instead report an
error in GtkBuilder if the property does not exist.
2019-12-24 15:36:08 -05:00
Matthias Clasen
8febf5e98a Spread single-click-activate api
This makes sense to have in all the views,
not just GtkListView.
2019-12-24 15:36:08 -05:00
Matthias Clasen
1d9e09aaca printdialog: Port to column view
This is not 100% complete. The search is not there yet.
2019-12-24 15:36:08 -05:00
Matthias Clasen
eecb8092dc printer: Fix the default value of icon-name
Just set this to "printer", so we don't have
to fix it up in the print dialog.
2019-12-24 15:36:08 -05:00
Matthias Clasen
ddd504ddfe printbackend: Add a list model getter
Now that we have a list model for printers,
we can start using it.
2019-12-24 15:36:08 -05:00
Matthias Clasen
4044a8cc6c printbackend: Use a list store 2019-12-24 15:36:08 -05:00
Matthias Clasen
05c869d19b inspector: Expand the actions list 2019-12-24 15:36:08 -05:00
Matthias Clasen
57d635e1a1 inspector: Expand the resource list
This is an experiment with adding a filler column.
2019-12-24 15:36:08 -05:00
Matthias Clasen
2c1a0d3d2e inspector: Expand the property list
It looks better this way.
2019-12-24 15:36:08 -05:00
Matthias Clasen
d5d3b4b991 inspector: Expand the object tree
This is how it used to look, and it looks better that way.
2019-12-24 15:36:08 -05:00
Matthias Clasen
19166f15e3 columnview: Take expand into account
When allocating columns, distribute extra space
to columns that have expand set to TRUE.
2019-12-24 15:36:08 -05:00
Matthias Clasen
fe31c2221c columnviewcolumn: Add an expand property
This will be used to determine how to distribute
available extra space in a column view.
2019-12-24 15:36:08 -05:00
Matthias Clasen
50e8ccf030 gtk-demo: Add more scrolling benchmarks
Add a listview and gridview to the scrolling
benchmarks.
2019-12-24 15:36:08 -05:00
Matthias Clasen
7539fe1acc gtk-demo: Make gridview demo use rubberbanding 2019-12-24 15:36:08 -05:00
Matthias Clasen
ee03ae8b9b Add rubberband api
Add an enable-rubberband property to GtkListView,
GtkGridView and GtkColumnView.
2019-12-24 15:36:08 -05:00
Matthias Clasen
7bf21cf9d2 listbase: Add rubberband selection
Implement the typical rubberband selection, including
autoscroll. This is only useful with multiselection,
and not very compatible with single-click-activate.
Therefore, it is not enabled by default, and needs
to be turned on with the enable-rubber-band property.
2019-12-24 15:36:08 -05:00
Matthias Clasen
466aec41f5 multiselection: Add a copy constructor
Add a function to create a multiselection that
is a copy of an existing selection model. We
can do this efficiently if the original is a
multiselection as well, by just copying the
entire set in on go.
2019-12-24 15:36:08 -05:00
Matthias Clasen
5e9adeb9bf Add GtkMultiSelection
This is implemented using a private GtkSet helper.
2019-12-24 15:36:08 -05:00
Matthias Clasen
c7b2307a0b columnviewtitle: Display a context menu
When the ::header-menu property is set on the
column, use the menu model to create and show
a context menu.
2019-12-24 15:36:08 -05:00
Matthias Clasen
6e838098cb columnviewcolumn: Add a menu property
Add a ::header-menu property that will be used
to create a context menu for the header of the
column.
2019-12-24 15:36:08 -05:00
Matthias Clasen
ee76623e54 Add a selection model test
The test shows that we are failing to emit
::selection-changed in some circumstances.
2019-12-24 15:36:08 -05:00
Matthias Clasen
36aaece297 testcolumnview: Reordering in the column editor
Use Ctrl-Up/Down to move the column around.
2019-12-24 15:36:08 -05:00
Matthias Clasen
4c8de636ce testcolumnview: Flesh out column editor
Turn the column list into an editor with
controls for visibility, resizability, reorderability
and width.
2019-12-24 15:36:08 -05:00
Matthias Clasen
8c086dbdc7 columview: Add autoscroll
Autoscroll when the pointer gets close to the
edge during column resizing or reordering. This
is similar to what the treeview does, but it is
implemented using a tick callback, and has
variable speed.
2019-12-24 15:36:08 -05:00
Matthias Clasen
f86aeaf8cd columnview: Allow to cancel reorder with Escape
The treeview does this too.
2019-12-24 15:36:08 -05:00
Matthias Clasen
c814864a3f columnview: Interactive column reordering
Allow rearranging columns by dragging, in the same
way the treeview does.

We add the "dnd" style class to the header while
it is dragged, and we move the header of the dragged
column to the end of its parents children, so that
it gets drawn on top.
2019-12-24 15:36:08 -05:00
Matthias Clasen
9e9d4d914e columnviewcolumn: Add a reorderable property
This will be used for interactive column reordering
in the future.
2019-12-24 15:36:08 -05:00
Matthias Clasen
8f2351d5d3 columnviewlayout: Use header allocation for titles
Normally, this will be identical to the column
allocation, but we will temporarily change it
during column reordering.
2019-12-24 15:36:08 -05:00
Matthias Clasen
4817c7757b 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.
2019-12-24 15:36:08 -05:00
Matthias Clasen
a44c4b4877 columnviewtitle: Invert on release
This is necessary to make drag-to-reorder work
without triggering inversion.
2019-12-24 15:36:08 -05:00
Matthias Clasen
f8a14427ea columnview: Interactive column resizing
This copies just enough of the treeview code to
get columns moving.
2019-12-24 15:36:08 -05:00
Matthias Clasen
9d0904a445 columnviewcolumn: Add a helper
We need to check whether clicks are in the headers
of columns, so let the column view get at the the
header widget.
2019-12-24 15:36:08 -05:00
Matthias Clasen
4a659c169d columnviewcolumn: Add a resizable property
This will be used for interactive column resizing
in the future.
2019-12-24 15:36:08 -05:00
Matthias Clasen
5ca53555c7 Turn GtkRecentInfo into an object
This is in preparation to eventually using
a list model of recent infos.
2019-12-24 15:36:08 -05:00
Matthias Clasen
0bbc074e08 gtk-demo: Add row reordering to the settings demo 2019-12-24 15:36:08 -05:00
Matthias Clasen
7af244944a gtk-demo: Add filtering to the settings demo
A demo of filtering with lists was missing so far.
2019-12-24 15:36:08 -05:00
Matthias Clasen
ae084d2929 gtk-demo: Crank up max columns of gridview
This lets us fit more cells on screen.
2019-12-24 15:36:08 -05:00
Matthias Clasen
fe3dd5cd8b gtk-demo: Make gridview content switchable
Add a dropdown to switch out the item factory.
2019-12-24 15:36:08 -05:00
Matthias Clasen
3dbac6b133 gtk-demo: Add sorting to the gridview demo 2019-12-24 15:36:08 -05:00
Matthias Clasen
2cb5ce8c72 gtk-demo: Cosmetic changes for the flowbox demo
Mention the size of the dataset.
2019-12-24 15:36:08 -05:00
Matthias Clasen
8ae6e58e0c gtk-demo: Cosmetic changes to the file browser demo
Mention that it involves switching between
different views.
2019-12-24 15:36:08 -05:00
Matthias Clasen
6eebc9183a gtk-demo: Cosmetic changes for the weather demo
Give the weather demo a size and a title, and mention
the size of the dataset in the description.
2019-12-24 15:36:08 -05:00