Commit Graph

75190 Commits

Author SHA1 Message Date
Matthias Clasen
89d131de56 gtk4-demo: Add tooltips to the menu demo
Not great UI, but better than nothing.
2023-03-11 00:07:07 +01:00
Matthias Clasen
a35dc8dda6 Rename the menu demo
At this point, the Menu demo is more about scaling images
than about menus, so rename it to Image Scaling.
2023-03-11 00:03:05 +01:00
Matthias Clasen
f00659d97f gtk-demo: Add a file chooser to the menu demo
So we can try this with bigger images.
2023-03-10 23:51:17 +01:00
Matthias Clasen
0f02040292 gsk: Cache scaled texture
Keep the texture we create for texture scale nodes.

Fixes: #5642
2023-03-10 21:09:27 +01:00
Yuri Chornoivan
4014e956cd Update Ukrainian translation 2023-03-10 19:24:32 +00:00
Benjamin Otte
6029c006b3 Merge branch 'wip/otte/filefilter-name' into 'main'
filefilter: If not given a name, deduce one

See merge request GNOME/gtk!5630
2023-03-10 17:11:25 +00:00
Jiri Grönroos
9ca2289547 Update Finnish translation 2023-03-10 17:03:35 +00:00
Matthias Clasen
72454a7113 Merge branch 'reverse-file-chooser-recent-files-sort-order' into 'main'
filerchooser: Show Recent files in inverse order

See merge request GNOME/gtk!5625
2023-03-10 16:40:50 +00:00
Matthias Clasen
e3dc282cc1 Merge branch 'wip/otte/listview-border-spacing' into 'main'
Implement CSS border-spacing support for listview and gridview

See merge request GNOME/gtk!5626
2023-03-10 16:39:05 +00:00
Matthias Clasen
5f24218123 Merge branch 'file-chooser-selectability2' into 'main'
file system model: Store selectability

See merge request GNOME/gtk!5582
2023-03-10 16:37:41 +00:00
Matthias Clasen
feebd68dd3 Merge branch 'notify_after_value_change' into 'main'
a11y: Notify assistive technologies when a GTK_ACCESSIBLE_PROPERTY_VALUE_NOW changes on a widget

See merge request GNOME/gtk!5624
2023-03-10 16:36:41 +00:00
Lukáš Tyrychtr
acf3f6beda a11y: Notify assistive technologies when a GTK_ACCESSIBLE_PROPERTY_VALUE_NOW changes on a widget
This fixes silent sliders and similar controls when their value is changed.
2023-03-10 16:36:39 +00:00
Benjamin Otte
5c9fb3a636 filefilter: If not given a name, deduce one
Otherwise we end up with a critical when cosntructing the GVariant and
the portal claims our filter is for "[Invalid UTF-8]".

Test included
2023-03-10 17:10:30 +01:00
Benjamin Otte
6a874e6887 gridview: Add border-spacing support
omg, this is complicated code.
2023-03-10 17:03:33 +01:00
Benjamin Otte
4b73be18c7 gridview: Introduce column size functions
This is in preparation for border-spacing integration.
2023-03-10 17:03:33 +01:00
Benjamin Otte
670cf6201d gridview: Use gtk_list_item_manager_get_nearest_tile()
Simplifies gtk_grid_view_get_position_from_allocation() a bit because we
can omit the bounds shenanigan.
2023-03-10 17:03:33 +01:00
Benjamin Otte
196372f124 listview: Support CSS border-spacing
Hopefully the code can deal with gaps between the tiles.

We use gtk_list_item_manager_get_nearest_tile() when necessary.
2023-03-10 17:03:21 +01:00
Matthias Clasen
310662516b filechooser: Set selectability for list items
We propagate this from the list items to the
GtkListItems. Twisty!
2023-03-10 15:40:43 +01:00
Matthias Clasen
70b430edff filechooser: Dim non-selectable items 2023-03-10 15:40:43 +01:00
Matthias Clasen
c8a720aaa5 columview: Propagate activatable and selectable
When any of the cells is not activatable or selectable,
make the row not have those properties either.
2023-03-10 15:40:43 +01:00
Matthias Clasen
85d6f39ac7 filechooser: Inform the model about selectability
In folder modes, we don't want to select files.
2023-03-10 15:40:43 +01:00
Matthias Clasen
a916e00dac filesystemmodel: Store selectability
This will be used later on.
2023-03-10 15:40:40 +01:00
Matthias Clasen
913798b1d0 Merge branch 'file-chooser-selection' into 'main'
filechooser: Don't automatically select a file

See merge request GNOME/gtk!5572
2023-03-10 14:25:36 +00:00
Fabio Tomat
70fe37cf1b Update Friulian translation 2023-03-10 07:49:25 +00:00
Benjamin Otte
5583fa60c1 listitemmanager: Add gtk_list_item_manager_get_nearest_tile()
... 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.
2023-03-10 05:35:17 +01:00
Benjamin Otte
97e3c65251 listview: Move bounds check into base class
This way, listview and gridview don't need to check if the rect is out
of bounds and nothing is selected, a quick rectangle_intersect() does
the job for them.
2023-03-10 05:26:28 +01:00
Benjamin Otte
334ca12d78 listview: Return an allocation for unallcoated items
Just get the position right and give them a height of 0px, that should
be good enough.

If we don't do that, code will think the item doesn't exist, which is
not what we want.
2023-03-10 05:26:28 +01:00
Ray Strode
442fa8d972 filerchooser: Show Recent files in inverse order
When looking at Recent files in the file chooser, it makes more
sense to show the recent files on top.

This commit flips the sort order for that case.
2023-03-09 15:42:16 -05:00
Matthias Clasen
12858114a2 Merge branch 'more-size-allocation-fixes' into 'main'
widget: Skip popovers in allocation

See merge request GNOME/gtk!5615
2023-03-08 22:26:51 +00:00
Matthias Clasen
4f6133e00a Merge branch 'wip/chergert/fix-const-preserving-text-iter-order' into 'main'
textlinedisplaycache: fix const-preserving gtk_text_iter_order()

See merge request GNOME/gtk!5620
2023-03-08 22:06:04 +00:00
Matthias Clasen
9ca3a52bf0 Merge branch 'file_chooser_stuff' into 'main'
filechooser: two small changes

See merge request GNOME/gtk!5619
2023-03-08 21:57:13 +00:00
Christian Hergert
40d99839d6 textlinedisplaycache: fix const-preserving gtk_text_iter_order() 2023-03-08 13:00:08 -08:00
Barnabás Pőcze
111e8d2808 filechooser: Do not look up parents of directories
If the `GtkRecentInfo` represents a directory, simply use it, and
do not try to find its parent in `_gtk_file_chooser_extract_recent_folders()`.

For example, there is an entry in my recently-used database
from the Amberol music player about the folder I have opened
with it, but the folder is not listed on the "Recent" tab of
the file chooser widget, only its parent. After this change,
the directory itself is shown.
2023-03-08 20:46:17 +01:00
Barnabás Pőcze
9b0b3029a6 filechooser: Use gtk_recent_info_is_local() for filtering
There is already a function for determining if URI
has the "file" scheme, so use that.
2023-03-08 20:04:41 +01:00
Matthias Clasen
f743b95161 Merge branch 'ebassi/issue-5650' into 'main'
Filter recently used files in the file chooser

Closes #5650

See merge request GNOME/gtk!5618
2023-03-08 18:45:10 +00:00
Matthias Clasen
bdd35c1695 Merge branch 'fix-msvc-older-glib' into 'main'
modules/media: Fix Visual Studio builds with older GLib (<= 2.74.x)

See merge request GNOME/gtk!5605
2023-03-08 18:44:46 +00:00
Matthias Clasen
2f273ba76a widget: Skip popovers in allocation
Native widgets get allocated via their surface,
so can skip them here. This avoids criticals when
re-mapping a popover for the second time, as can
be seen e.g. in the 'Selections' demo in gtk4-demo.
2023-03-08 13:40:51 -05:00
Matthias Clasen
a2d14632de widget: Stop propagating alloc_needed beyond popovers
This should not be necessary, since popovers get
their new size from present_popup via the compositor.
2023-03-08 13:40:48 -05:00
Benjamin Otte
7a3e130efd widget: Remove goto usage in widget_allocate() 2023-03-08 13:40:37 -05:00
Benjamin Otte
c8d356a250 widget: Split out gtk_widget_ensure_allocate_on_children()
allocate() should not be calling into ensure_allocate(), they do a similar job.
In the end, the code does the same work, but it should be easier to follow now.
2023-03-08 13:40:31 -05:00
Matthias Clasen
ffb7177c2e widget: Simplify size allocation
Don't call ensure_allocate if we've just
done size_allocate. This makes criticals
from reshowing popovers go away.
2023-03-08 13:39:54 -05:00
Emmanuele Bassi
8b2202cd56 Filter recently used files in the file chooser
Since it's a file selection widget, we should only list recently used
files that point to a file.

Fixes: #5650
2023-03-08 18:08:24 +00:00
Matthias Clasen
14a5c78d80 Merge branch 'wip/carlosg/reuse-search-engine' into 'main'
gtkfilechooser: Keep GtkSearchEngine around for longer

See merge request GNOME/gtk!5617
2023-03-08 12:58:43 +00:00
Carlos Garnacho
5fd2a6c8f3 gtkfilechooser: Keep GtkSearchEngine around for longer
Currently the GtkSearchEngine is torn down every time the search
is stopped, which also means between typed characters. This
prevents any of the optimizations that the GtkSearchEngine can
do in the long run.

Let the GtkSearchEngine stay around for longer, and only be
disposed after search is cancelled, the filechooser moves
onto a different mode than search, or is otherwise unmapped/disposed.

While at it, remove an unused struct field.
2023-03-08 13:23:56 +01:00
Matthias Clasen
6cb6f4a50f Merge branch 'wip/carlosg/recursive-file-search' into 'main'
searchengine: Improve performance for recursive search

Closes #4133

See merge request GNOME/gtk!5611
2023-03-08 11:56:41 +00:00
Carlos Garnacho
7b909fb310 searchengine: Do not fight filechooser search mode sorting
Provide the hits in an order that is more easily consumed by the
filechooser, and less jarring when populating.
2023-03-08 11:33:10 +01:00
Carlos Garnacho
d12bea03d2 searchengine: Bail out on the first character
Again on massive filesystems, the very first character
is likely to bring a likewise massive amount of search
results that we need to maybe query info for, then create
icons and widgets for. While it's impressive we can do
that, it's also expensive and likely pointless, for the
first character.

Typing a second character is however very likely to
considerably reduce the amount of items to categorize and
show. So start actually searching from there.

Testing on a filesystem with 1434099 files indexed, trying 5
semi-random 1 character searches (n, h, t, i, o) returns on
average 168K items (min. 78771, max. 331471), trying 5
semi-random 2 character searches (no, he, th, in, on)
returns on average 34K items (min. 11133, max. 94961),
which is a more approachable set.

Doing this is enough that typing on a filechooser search
entry feels completely fluid.
2023-03-08 11:33:10 +01:00
Carlos Garnacho
deacc63d54 searchengine: Ensure some GFileInfo fields
The search provider should make it sure there are some
specific GFileInfo fields set. Fix the mimetype extraction
from the query, and use that to fill in the missing gaps
the best we can.
2023-03-08 11:33:10 +01:00
Carlos Garnacho
ead121a3c1 searchengine: Drop non-recursive search
Recursive search seems to be the hardcoded default, go with it.
2023-03-08 11:33:10 +01:00
Carlos Garnacho
de4725dbd5 searchengine: Populate filesystem model in an idle
When starting a search over a very populated filesystem, it
is possible that typing the first chars will return a too
high number of results. Even though iterating through the
cursor is in itself very fast, extracting the GIO information
from those many files at once is not going to be as fast.

In order to increase interactivity (i.e. not make things
possibly sluggish) iterate the cursor in an idle function
and add search results to the filechooser model little by little.

If the user keeps typing (as it is likely will happen), there
will be better chances to cancel and proceed to the next
query timely. If not, the results will be there soon enough.
2023-03-08 11:32:44 +01:00