Commit Graph

36048 Commits

Author SHA1 Message Date
Matthias Clasen
dfc04a590d inspector: Reshuffle the sidebar
Move the sidebar in the object page below the
object header, for a more logical hierarchy.
2020-07-07 02:05:18 -04:00
Matthias Clasen
fe5b364675 inspector: Drop unused properties
The individual pages no longer need the object tree
to show object details, this works with the window
now.
2020-07-07 01:25:21 -04:00
Matthias Clasen
0b38a0663d inspector: Add dom-like navigation controls
Maintain a stack of objects, and add ˂˅˄˃ buttons
that navigate this stack, as well as the widget
tree and list models.
2020-07-07 00:51:18 -04:00
Matthias Clasen
e5c0716293 inspector: Remove an unused field 2020-07-07 00:48:43 -04:00
Matthias Clasen
54a3293cad stack: Fix handling of GtkStackPage:visible
The stack wasn't updating its visible-child when
the stack pages visible property changes. This
showed up in the inspector, when showing the details
for a list model item.
2020-07-07 00:48:43 -04:00
Matthias Clasen
729ba44297 Merge branch 'wip/otte/filterlistmodel' into 'master'
Improve GtkFilterListModel

See merge request GNOME/gtk!2199
2020-07-06 15:42:44 +00:00
Matthias Clasen
e7b773b031 filechooser: Add a readonly :shortcut-folders property
This makes the shortcut folders list accessible in the
the inspector.
2020-07-06 11:03:48 -04:00
Matthias Clasen
57a225681c filechooser: Add gtk_file_chooser_get_shortcuts
Replace gtk_file_chooser_list_shortcuts with a new
api that returns a list model.

Update all callers.
2020-07-06 11:03:48 -04:00
Matthias Clasen
ea07a92366 filechooser: Add a readonly :filters property
This makes the filters list accessible in the
the inspector.
2020-07-06 11:03:48 -04:00
Matthias Clasen
76290e8ddb filechooser: Add gtk_file_chooser_get_filters
Replace gtk_file_chooser_list_filters with a new
api that returns a list model.

Update all callers.
2020-07-06 10:36:35 -04:00
Benjamin Otte
3162e25671 bitset: Fix typo: gtk_bitset_slice() => gtk_bitset_splice() 2020-07-06 03:42:43 +02:00
Benjamin Otte
3d931b4fe2 bitset: Don't overflow when splicing
Testcase added.
2020-07-06 03:42:43 +02:00
Benjamin Otte
66fa9380b5 filterlistmodel: Look at type of change
This way we can avoid refiltering most of an already filtered list when
the change becomes more strict.
2020-07-06 03:42:43 +02:00
Benjamin Otte
9b2d8ac362 filterlistmodel: Add gtk_filter_list_model_get_pending()
This allows tracking if the model is busy filtering.
2020-07-06 03:42:43 +02:00
Benjamin Otte
2a90bc1a9b filterlistmodel: Add incremental filtering 2020-07-06 03:42:43 +02:00
Benjamin Otte
d4b868d9bc filterlistmodel: Rewrite with bitset data structure
Bitsets are more powerful, less memory intensive and faster than the old
GtkRbTree version.
2020-07-06 03:42:43 +02:00
Matthias Clasen
1a613de2f6 filefilter: Cosmetics 2020-07-05 19:54:20 -04:00
Matthias Clasen
665df37703 filefilter: Header file cosmetics 2020-07-05 19:36:45 -04:00
Matthias Clasen
acad5e4e3d filefilter: Fix an embarrassing oversight
I forgot to remove some dead code, and left the
pixbuf_formats list in the rule union. Oops.
2020-07-05 19:32:36 -04:00
Matthias Clasen
5a2f791bdd filefilter: Cleanups and optimizations
Make mime-type rules hold multiple types. Store the
content types, so we don't have to do mime-type -> content-type
conversion in the match function. Store content types for the
pixbuf-formats rule as well, so we can avoid memory allocation
in the match function altogether.
2020-07-05 15:12:07 -04:00
Matthias Clasen
286a00a1db docs: Cleanups for the file filter docs
Now that GtkFileFilter is a GtkFilter, move it to the
filter section of the docs. While we are at it, touch
up the docs in some places.
2020-07-05 15:10:18 -04:00
Matthias Clasen
11dd602b28 Drop gtk_file_filter_filter
It has been superseded by gtk_filter_match.
2020-07-05 15:10:18 -04:00
Matthias Clasen
35988d659d Stop using gtk_file_filter_filter
Make all users of GtkFileFilter use it via the
GtkFilter api. This is in preparation for dropping
gtk_filter_filter_filter.
2020-07-05 15:10:18 -04:00
Matthias Clasen
be3449b3ce filefilter: Convert to a GtkFilter
Make GtkFileFilter implement GtkFilter.
2020-07-05 15:10:18 -04:00
Matthias Clasen
2d8fddc1e9 filefilter: Drop GtkFileFilterFlags
Replace gtk_file_filter_get_needed by gtk_file_filter_get_attributes,
which directly returns the attributes that are needed.

Update all callers.
2020-07-05 15:10:13 -04:00
Matthias Clasen
644d522d19 filefilter: Drop custom filters
These don't work with native file choosers.
2020-07-05 14:34:33 -04:00
Matthias Clasen
a8b0125da1 filefilter: Drop GtkFileFilterInfo
We can just make the filter operate on GFileInfo.
This is in preparation for making GtkFileFilter a
GtkFilter.

Update all users.
2020-07-05 13:55:42 -04:00
Matthias Clasen
acccac516e filefiler: No more floating
Make GtkFileFilter not be initially unowned anymore.
This is in preparation for deriving GtkFileFilter
from GtkFilter. Update all callers.
2020-07-05 12:36:47 -04:00
Benjamin Otte
1dbb8df95f stringlist: Export gtk_string_object_new()
There are various use cases where it makes sense to construct these -
from our internal testing to using them in flatten- or mapmodels.
2020-07-05 02:59:21 +02:00
Benjamin Otte
f6c2c2edbd stringlist: Call splice() for adding items after construction
This has the benefit of actually allowing NULL to be passed.
2020-07-05 02:59:21 +02:00
Benjamin Otte
c4e4de36f6 stringlist: Remove n_additions argument from gtk_string_list_splice()
char ** arrays are null-terminated everywhere, so make sure they are in
splice(), too.

Also fix the argument to be a const char * const * like in the
constructor.
2020-07-05 02:59:21 +02:00
Benjamin Otte
67cbb2a7d3 stringlist: Clarify docs for gtk_string_list_get_string()
Make sure it's obvious that it behaves like g_list_model_get_item() and
returns NULL for pos >= n_items.
2020-07-05 02:59:21 +02:00
Benjamin Otte
a979daa8ea stringlist: Make one constructor call the other
Simplifies code.
2020-07-05 02:59:21 +02:00
Benjamin Otte
fb14f50ec1 stringlist: Make property not construct-only
Massively speeds up creation of long stringlists.
2020-07-05 02:59:21 +02:00
Benjamin Otte
6099fbafc1 bitset: Add gtk_bitset_new_range()
It's a common use.
2020-07-05 02:59:21 +02:00
Benjamin Otte
795d3122cc selectionmodels: Add set_model() support
Now that we don't care about item types anymore, we can make the child
models settable.

We try to retain the selection, even when the model changes.
2020-07-05 02:59:21 +02:00
Benjamin Otte
5080730728 listmodels: Stop respecting item-type
Simplify all view model APIs and always return G_TYPE_OBJECT as the
item-type for every model.

It turns out nobody uses item-type anyway.

So instead of adding lots of APIs, forcing people to think about it and
trying to figure out how to handle filter or map models that modify item
types, just having an easy life is a better approach.

All the models need to be able to deal with any type of object going
through anyway.
2020-07-05 02:59:21 +02:00
Benjamin Otte
f75a3a0e95 stringlist: Take a const char const * argument
Sucks that we need to cast a char**, but otherwise we need to cast
{"foo", "bar", "baz" } arrays.
2020-07-05 02:34:42 +02:00
Benjamin Otte
b75db7d1c6 stringfilter: Don't crash if the expression returns "" 2020-07-05 00:34:21 +02:00
Benjamin Otte
b03069bdf6 a11y: Remove double initialization of variables 2020-07-05 00:34:21 +02:00
Matthias Clasen
9332d0dcc8 Merge branch 'typo' into 'master'
Fixes typos

See merge request GNOME/gtk!2188
2020-07-04 15:48:29 +00:00
Matthias Clasen
69975627e9 filechooser: Make filtering work again
One too many lines were dropped when this filter combo
was converted to a dropdown. Bring it back, to make
filtering work again.
2020-07-04 10:28:10 -04:00
Jordi Mas
599b807726 Fixes typos 2020-07-04 10:00:25 +02:00
Matthias Clasen
c2da2f7ecd selectionfilter: Fix bugs in signal translation
When the position is 0, we can't check for unchanged
elements below with gtk_bitset_size_in_range. And
we don't need to, either.

And be careful when translating [start,length]
intervals to [first,last] ones. Off-by-one errors
lurk everywhere.
2020-07-03 11:12:55 -04:00
Matthias Clasen
f01d695e6c Merge branch 'matthiasc/for-master' into 'master'
inspector: Fix the monitor list width

Closes #2909

See merge request GNOME/gtk!2185
2020-07-03 05:51:29 +00:00
Matthias Clasen
619b2465c1 inspector: Fix the monitor list width
Fixes #2909
2020-07-03 01:07:13 -04:00
Matthias Clasen
cc18191a8e Merge branch 'wip/exalm/show-title-buttons' into 'master'
headerbar: Show title buttons by default

See merge request GNOME/gtk!2175
2020-07-03 05:05:24 +00:00
Matthias Clasen
76533513c2 Add a selection filter model
This model presents the selection of a GtkSelectionModel
as its own list model.
2020-07-02 22:59:03 -04:00
Matthias Clasen
0d3988365b filterlistmodel: Make model not construct-only
This property wasn't meant to be construct-only.
2020-07-02 22:59:03 -04:00
Benjamin Otte
0966636803 bitset: Add APIs needed for a filterlistmodel 2020-07-02 17:19:16 -04:00