gtk4.git
3 years agoDeprecate GtkDialog
Matthias Clasen [Sat, 29 Oct 2022 17:53:47 +0000 (13:53 -0400)]
Deprecate GtkDialog

GtkDialog is too flexible in terms of UI (headerbars vs action bar,
etc), and has archaic APIs. It is time to retire it.

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sat, 29 Oct 2022 19:22:50 +0000 (19:22 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Docs updates

See merge request GNOME/gtk!5180

3 years agoUpdate docs
Matthias Clasen [Sat, 29 Oct 2022 18:13:56 +0000 (14:13 -0400)]
Update docs

Mention new deprecations in the future migration guide.

3 years agoMerge branch 'async-dialog-api2' into 'main'
Matthias Clasen [Sat, 29 Oct 2022 17:52:13 +0000 (17:52 +0000)]
Merge branch 'async-dialog-api2' into 'main'

Add new async APIs to replace chooser dialogs

See merge request GNOME/gtk!5174

3 years agoNEWS: Updates
Matthias Clasen [Sat, 29 Oct 2022 16:06:26 +0000 (12:06 -0400)]
NEWS: Updates

3 years agoDeprecate GtkFileChooser and implementations
Matthias Clasen [Sat, 29 Oct 2022 15:31:35 +0000 (11:31 -0400)]
Deprecate GtkFileChooser and implementations

These are being replaced by GtkFileDialog.

This commit only moves the headers for GtkFileChooserWidget and
GtkFileChooserDialog to deprecated/, and keeps the implementations
in gtk/, since they will eventually be salvaged into a private
GtkFileChooserWindow.

3 years agoDeprecate GtkMessageDialog
Matthias Clasen [Sat, 29 Oct 2022 14:36:29 +0000 (10:36 -0400)]
Deprecate GtkMessageDialog

It is getting replaced by GtkAlertDialog

This commit only moves the header to deprecated/,
and keeps the implementation in gtk/, since it will
eventually be salvaged into a private, dialog-free
widget.

3 years agoDeprecate GtkFontChooser and implementations
Matthias Clasen [Thu, 27 Oct 2022 02:58:21 +0000 (22:58 -0400)]
Deprecate GtkFontChooser and implementations

These are being replaced by GtkFontDialog
and GtkFontDialogButton

This commit only moves the headers for GtkFontChooserWidget and
GtkFontChooserDialog to deprecated/, and keeps the implementations
in gtk/, since they will eventually be salvaged into a private
GtkFontChooserWindow.

3 years agoDeprecate GtkColorChooser and implementations
Matthias Clasen [Thu, 27 Oct 2022 01:52:06 +0000 (21:52 -0400)]
Deprecate GtkColorChooser and implementations

These are being replaced by GtkColorDialog
and GtkColorDialogButton.

This commit only moves the headers for GtkColorChooserWidget
and GtkColorChooserDialog to deprecated/, and keeps the
implementations in gtk/, since they will eventually be
salvaged into a private GtkColorChooserWindow.

3 years agoexamples: Port to async dialog API
Matthias Clasen [Sat, 29 Oct 2022 03:07:12 +0000 (23:07 -0400)]
examples: Port to async dialog API

3 years agoprint-editor: Port to async dialog API
Matthias Clasen [Sat, 29 Oct 2022 02:42:32 +0000 (22:42 -0400)]
print-editor: Port to async dialog API

3 years agonode-editor: Port to async dialog API
Matthias Clasen [Sat, 29 Oct 2022 00:43:37 +0000 (20:43 -0400)]
node-editor: Port to async dialog API

3 years agoconstraint-editor: Port to async dialog API
Matthias Clasen [Sat, 29 Oct 2022 00:24:53 +0000 (20:24 -0400)]
constraint-editor: Port to async dialog API

3 years agowidget-factory: Port to async dialog API
Matthias Clasen [Sat, 29 Oct 2022 00:16:21 +0000 (20:16 -0400)]
widget-factory: Port to async dialog API

3 years agogtk-demo: Port to async dialog API
Matthias Clasen [Fri, 28 Oct 2022 15:38:57 +0000 (11:38 -0400)]
gtk-demo: Port to async dialog API

3 years agogtk-demo: Rewrite the pickers demo
Matthias Clasen [Wed, 26 Oct 2022 17:38:22 +0000 (13:38 -0400)]
gtk-demo: Rewrite the pickers demo

This needs some more work. For now, just have
very simple test cases for some of the new async
APIs.

3 years agoinspector: Port to async dialog API
Matthias Clasen [Fri, 28 Oct 2022 14:00:37 +0000 (10:00 -0400)]
inspector: Port to async dialog API

3 years agogtk: Port to async dialog API
Matthias Clasen [Fri, 28 Oct 2022 15:32:55 +0000 (11:32 -0400)]
gtk: Port to async dialog API

3 years agoAdd GtkFileDialog
Matthias Clasen [Mon, 24 Oct 2022 10:54:01 +0000 (06:54 -0400)]
Add GtkFileDialog

Add an async API for picking a file, together with
a builder object for it. This is meant to replace direct
use of GtkFileChooserDialog.

3 years agoAdd GtkAlertDialog
Matthias Clasen [Tue, 25 Oct 2022 04:12:28 +0000 (00:12 -0400)]
Add GtkAlertDialog

This is replacing GtkMessageDialog with an
async API for showing informational messages.

3 years agoAdd GtkFontDialogButton
Matthias Clasen [Tue, 25 Oct 2022 03:09:02 +0000 (23:09 -0400)]
Add GtkFontDialogButton

This is like GtkColorDialogButton, but for fonts.

3 years agoAdd GtkFontDialog
Matthias Clasen [Mon, 24 Oct 2022 03:21:41 +0000 (23:21 -0400)]
Add GtkFontDialog

This is similar to GtkColorDialog, but for fonts.

3 years agoAdd GtkColorDialogButton
Matthias Clasen [Mon, 24 Oct 2022 19:42:52 +0000 (15:42 -0400)]
Add GtkColorDialogButton

This is a new color button implementation
built around GtkColorDialog.

3 years agoAdd GtkColorDialog
Matthias Clasen [Mon, 24 Oct 2022 19:41:43 +0000 (15:41 -0400)]
Add GtkColorDialog

Add an async API for picking a color, together with
a builder object for it. This is meant to replace direct
use of GtkColorChooserDialog.

3 years agoAdd GtkDialogError
Matthias Clasen [Thu, 27 Oct 2022 01:27:24 +0000 (21:27 -0400)]
Add GtkDialogError

This error domain will be used by async apis
in future commits.

3 years agofontchooser: Add a way to set a GtkFilter
Matthias Clasen [Sat, 29 Oct 2022 03:58:50 +0000 (23:58 -0400)]
fontchooser: Add a way to set a GtkFilter

We keep this private, since the chooser apis
are going away. This will be used in GtkFontDialog.

3 years agomessagedialog: Cosmetics
Matthias Clasen [Fri, 28 Oct 2022 19:24:23 +0000 (15:24 -0400)]
messagedialog: Cosmetics

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sat, 29 Oct 2022 02:08:19 +0000 (02:08 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

ci: Try to fix the macos build

See merge request GNOME/gtk!5179

3 years agoci: Require macos to build again
Matthias Clasen [Sat, 29 Oct 2022 01:38:14 +0000 (21:38 -0400)]
ci: Require macos to build again

3 years agoci: Try to fix the macos build
Matthias Clasen [Sat, 29 Oct 2022 01:03:56 +0000 (21:03 -0400)]
ci: Try to fix the macos build

It seems that libjpeg-turbo first finds nasm,
and then doesn't find it. Turn off simd to keep
it from looking for it in the first place.

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 28 Oct 2022 23:41:03 +0000 (23:41 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

printeroptionwidget: Drop unused include

See merge request GNOME/gtk!5178

3 years agoprinteroptionwidget: Drop unused include
Matthias Clasen [Fri, 28 Oct 2022 15:03:36 +0000 (11:03 -0400)]
printeroptionwidget: Drop unused include

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 28 Oct 2022 16:20:18 +0000 (16:20 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

gtk4-demo: Avoid a critical from a11y code

See merge request GNOME/gtk!5177

3 years agogtk4-demo: Avoid a critical from a11y code
Matthias Clasen [Fri, 28 Oct 2022 15:59:35 +0000 (11:59 -0400)]
gtk4-demo: Avoid a critical from a11y code

Even though we want to be accessible,
we must not divide by zero.

3 years agoMerge branch 'bilelmoussaoui/file-chooser-gi' into 'main'
Emmanuele Bassi [Thu, 27 Oct 2022 17:06:22 +0000 (17:06 +0000)]
Merge branch 'bilelmoussaoui/file-chooser-gi' into 'main'

g-i: Add missing since annotation

See merge request GNOME/gtk!5175

3 years agog-i: Add missing since annotation
Bilal Elmoussaoui [Thu, 27 Oct 2022 15:38:14 +0000 (15:38 +0000)]
g-i: Add missing since annotation

3 years agoMerge branch 'revert-9c919ffa462dd4511da0bfd19d36d2e15c51651b-main' into 'main'
Matthias Clasen [Wed, 26 Oct 2022 18:22:43 +0000 (18:22 +0000)]
Merge branch 'revert-9c919ffa462dd4511da0bfd19d36d2e15c51651b-main' into 'main'

Revert "treepopover: Do not propagate natural width of content"

See merge request GNOME/gtk!5171

3 years agoRevert "treepopover: Do not propagate natural width of content"
Mat [Wed, 26 Oct 2022 10:58:10 +0000 (13:58 +0300)]
Revert "treepopover: Do not propagate natural width of content"

This reverts commit 9c919ffa462dd4511da0bfd19d36d2e15c51651b.

3 years agoMerge branch 'ebassi/glade-docs' into 'main'
Matthias Clasen [Tue, 25 Oct 2022 00:39:57 +0000 (00:39 +0000)]
Merge branch 'ebassi/glade-docs' into 'main'

docs: Remove mentions of Glade

See merge request GNOME/gtk!5168

3 years agodocs: Remove mentions of Glade
Emmanuele Bassi [Mon, 24 Oct 2022 19:04:03 +0000 (20:04 +0100)]
docs: Remove mentions of Glade

Glade does not support GTK4, so we should not link to it when discussing
developing GTK4 applications.

3 years agoUpdate Serbian translation
Мирослав Николић [Sun, 23 Oct 2022 09:21:30 +0000 (09:21 +0000)]
Update Serbian translation

(cherry picked from commit b760f57ae1323669348b6bc84c384d24f4b381ff)

3 years agoMerge branch 'deprecation-cleanups' into 'main'
Matthias Clasen [Sat, 22 Oct 2022 19:23:45 +0000 (19:23 +0000)]
Merge branch 'deprecation-cleanups' into 'main'

gtk-demo: Replace combo boxes in font features

See merge request GNOME/gtk!5164

3 years agogtk-demo: Use global style in font_features
Matthias Clasen [Sat, 22 Oct 2022 15:38:46 +0000 (11:38 -0400)]
gtk-demo: Use global style in font_features

3 years agogtk-demo: Replace combo boxes in font features
Matthias Clasen [Sat, 22 Oct 2022 14:11:28 +0000 (10:11 -0400)]
gtk-demo: Replace combo boxes in font features

This is a slightly more complicated combo box,
so we need an auxiliary object.

3 years agoMerge branch 'deprecation-cleanups' into 'main'
Matthias Clasen [Sat, 22 Oct 2022 02:32:23 +0000 (02:32 +0000)]
Merge branch 'deprecation-cleanups' into 'main'

gtk-demo: Remove deprecations from dnd

See merge request GNOME/gtk!5160

3 years agobloatpad: Stop using a combobox
Matthias Clasen [Sat, 22 Oct 2022 02:03:17 +0000 (22:03 -0400)]
bloatpad: Stop using a combobox

Replace GtkComboBoxText with GtkDropDown+GtkStringList.

3 years agofontchooser: Stop using deprecated harfbuzz api
Matthias Clasen [Sat, 22 Oct 2022 01:54:38 +0000 (21:54 -0400)]
fontchooser: Stop using deprecated harfbuzz api

The replacement is very straightforward.

3 years agogtk-demo: Replace combobox in font rendering
Matthias Clasen [Sat, 22 Oct 2022 01:24:48 +0000 (21:24 -0400)]
gtk-demo: Replace combobox in font rendering

Out with the combobox, in with the dropdown.

3 years agoplacesview: Drop deprecation guards
Matthias Clasen [Sat, 22 Oct 2022 01:11:46 +0000 (21:11 -0400)]
placesview: Drop deprecation guards

We got rid of all deprecated api here.

3 years agofilechooserwidget: Drop deprecation guards
Matthias Clasen [Sat, 22 Oct 2022 01:10:39 +0000 (21:10 -0400)]
filechooserwidget: Drop deprecation guards

We got rid of all deprecated api here.

3 years agofilesystemmodel: Drop outdated comments
Matthias Clasen [Sat, 22 Oct 2022 01:09:24 +0000 (21:09 -0400)]
filesystemmodel: Drop outdated comments

Drop a long comment describing an implementation
that no longer exists.

3 years agofilesystemmodel: Drop unneded deprecation guards
Matthias Clasen [Sat, 22 Oct 2022 01:08:27 +0000 (21:08 -0400)]
filesystemmodel: Drop unneded deprecation guards

Nothing deprecated is used here anymore.

3 years agosearchenginemodel: Drop unneeded deprecation guards
Matthias Clasen [Sat, 22 Oct 2022 01:05:03 +0000 (21:05 -0400)]
searchenginemodel: Drop unneeded deprecation guards

Nothing deprecated is used here anymore.

3 years agogtk-demo: Remove deprecations from characters
Matthias Clasen [Sat, 22 Oct 2022 00:58:26 +0000 (20:58 -0400)]
gtk-demo: Remove deprecations from characters

Make the characters demo use global style providers.

3 years agogtk-demo: Remove deprecations from sizegroup demo
Matthias Clasen [Sat, 22 Oct 2022 00:49:38 +0000 (20:49 -0400)]
gtk-demo: Remove deprecations from sizegroup demo

Out with the comboboxes, in with the dropdowns.

3 years agogtk-demo: Remove deprecation from textview demo
Matthias Clasen [Fri, 21 Oct 2022 19:48:01 +0000 (15:48 -0400)]
gtk-demo: Remove deprecation from textview demo

Use a dropdown instead of a combobox for the widget
embedding. It's better!

3 years agogtk-demo: Remove deprecations from gltransitions
Matthias Clasen [Fri, 21 Oct 2022 19:18:10 +0000 (15:18 -0400)]
gtk-demo: Remove deprecations from gltransitions

Make the GL transitions demo use global style providers.

3 years agogtk-demo: Remove deprecations from solitaire
Matthias Clasen [Fri, 21 Oct 2022 18:41:59 +0000 (14:41 -0400)]
gtk-demo: Remove deprecations from solitaire

Make the solitaire game use global style providers.

3 years agogtk=demo: Drop unneeded deprecation guards
Matthias Clasen [Fri, 21 Oct 2022 18:29:38 +0000 (14:29 -0400)]
gtk=demo: Drop unneeded deprecation guards

Nothing deprecated in the pixbuf paintable demo.

3 years agogtk-demo: Remove deprecations from dnd
Matthias Clasen [Fri, 21 Oct 2022 18:16:38 +0000 (14:16 -0400)]
gtk-demo: Remove deprecations from dnd

Make the dnd demo use global style providers.

3 years agoMerge branch 'wip/corey/file-chooser-popup' into 'main'
Matthias Clasen [Sat, 22 Oct 2022 00:36:26 +0000 (00:36 +0000)]
Merge branch 'wip/corey/file-chooser-popup' into 'main'

filechooserwidget: Fix popup issues

See merge request GNOME/gtk!5161

3 years agofilechooserwidget: Show popup when clicking on empty space
Corey Berla [Fri, 21 Oct 2022 20:55:10 +0000 (13:55 -0700)]
filechooserwidget: Show popup when clicking on empty space

Add gesture to right click or long press in the empty space
in the FileChooserWidget.  Only show the global settings when
clicking on the empty space.

3 years agofilechoosercell: Select item when right click or long press
Corey Berla [Fri, 21 Oct 2022 20:53:49 +0000 (13:53 -0700)]
filechoosercell: Select item when right click or long press

3 years agofilechoosercell: Only use long press when in touch mode
Corey Berla [Fri, 21 Oct 2022 20:53:27 +0000 (13:53 -0700)]
filechoosercell: Only use long press when in touch mode

3 years agofilechoosercell: Claim sequence on click
Corey Berla [Fri, 21 Oct 2022 20:52:55 +0000 (13:52 -0700)]
filechoosercell: Claim sequence on click

3 years agoMerge branch 'gbsneto/filechooser-column-view' into 'main'
Matthias Clasen [Fri, 21 Oct 2022 19:42:24 +0000 (19:42 +0000)]
Merge branch 'gbsneto/filechooser-column-view' into 'main'

Port filechooser to GtkColumnView

See merge request GNOME/gtk!5108

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 21 Oct 2022 16:26:57 +0000 (16:26 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Bump the GLib requirement

See merge request GNOME/gtk!5158

3 years agofilesystemmodel: Fix a compiler warning
Matthias Clasen [Fri, 21 Oct 2022 14:40:51 +0000 (10:40 -0400)]
filesystemmodel: Fix a compiler warning

3 years agotheme: Fix up padding for the file chooser
Matthias Clasen [Fri, 21 Oct 2022 11:55:15 +0000 (07:55 -0400)]
theme: Fix up padding for the file chooser

We need the padding inside the filelistcell, so that
its event controllers cover the whole area.

Introduce a .complex style class for columnviews that
achieves that, and make the filechooser use it.

3 years agoBump the GLib requirement
Matthias Clasen [Fri, 21 Oct 2022 11:59:47 +0000 (07:59 -0400)]
Bump the GLib requirement

We now use GSignalGroup, which was introduced
in GLib 2.72.

3 years agofilesystemmodel: Fix a compiler warning
Matthias Clasen [Fri, 21 Oct 2022 11:44:13 +0000 (07:44 -0400)]
filesystemmodel: Fix a compiler warning

3 years agoMerge branch 'gtkcompostable-c-fix-c4013' into 'main'
Matthias Clasen [Fri, 21 Oct 2022 11:40:52 +0000 (11:40 +0000)]
Merge branch 'gtkcompostable-c-fix-c4013' into 'main'

gtkcomposetable.c: Fix build on non-X11

See merge request GNOME/gtk!5156

3 years agogtkcomposetable.c: Fix build on non-X11
Chun-wei Fan [Fri, 21 Oct 2022 04:15:29 +0000 (12:15 +0800)]
gtkcomposetable.c: Fix build on non-X11

The build breaks with a C4013 warning/error on Visual Studio because we don't
have a prototype defined for _gtk_get_datadir(), so include gtkprivate.h.

The vs2017-x64 CI did not catch this error because it is building GLib as a
fallback subproject, causing the msvc_recommended_pragmas.h header not to be
found, which is used to detect problems like this.

3 years agofilechooser: Make search results show up
Matthias Clasen [Fri, 21 Oct 2022 01:14:29 +0000 (21:14 -0400)]
filechooser: Make search results show up

The tracker search engine implementation was not
setting all the custom attributes that we require
now.

The quartz search engine will need similar fixes.

3 years agofilechooserwidget: Remember sort columns and order
Matthias Clasen [Thu, 20 Oct 2022 19:11:49 +0000 (15:11 -0400)]
filechooserwidget: Remember sort columns and order

These settings existed before, we keep using them.
This loses some information about sorting by multiple
columns, but it is sufficient to get the same primary
sort column back.

3 years agofilechooserwidget: Fix time_sort_func
Corey Berla [Wed, 19 Oct 2022 20:57:20 +0000 (13:57 -0700)]
filechooserwidget: Fix time_sort_func

3 years agofilechooser: Add show-time property
Corey Berla [Wed, 19 Oct 2022 19:42:56 +0000 (12:42 -0700)]
filechooser: Add show-time property

The "Show Time" setting does not take immediate effect (only after
changing folders) because it's set as a single call to
column_view_get_time_visible() on the FileChooserCell creation.
Instead create a bind a show-time property that gets updated
as the setting is changed.

3 years agofilechoosercell: Add a GtkDragSource
Corey Berla [Wed, 19 Oct 2022 16:20:53 +0000 (09:20 -0700)]
filechoosercell: Add a GtkDragSource

Allow dragging one or more items.  If the item dragged is not part of
the current selection, only drag that item.

3 years agofilechoosercell: Bind "item" and "selected" to cell
Corey Berla [Wed, 19 Oct 2022 16:19:47 +0000 (09:19 -0700)]
filechoosercell: Bind "item" and "selected" to cell

3 years agofilechooserwidget: Expose selection model
Corey Berla [Wed, 19 Oct 2022 16:17:39 +0000 (09:17 -0700)]
filechooserwidget: Expose selection model

FileChooserCell may need to change the selection during a DND.

3 years agofilechooserwidget: Rename and expose get_selected_files()
Corey Berla [Wed, 19 Oct 2022 16:16:45 +0000 (09:16 -0700)]
filechooserwidget: Rename and expose get_selected_files()

GtkFileChooserCell will need this function

3 years agofilechooserwidget: Make rename popover work
Matthias Clasen [Mon, 17 Oct 2022 01:40:00 +0000 (21:40 -0400)]
filechooserwidget: Make rename popover work

Make the rename popover operate on the file that
the context menu was opened for, and pop up at
the same position.

3 years agofilechooserwidget: Make context menus mostly work
Matthias Clasen [Fri, 14 Oct 2022 04:01:02 +0000 (00:01 -0400)]
filechooserwidget: Make context menus mostly work

Move the gestures to the individual cells, and
make them trigger the context menu via an action
that takes item position and coordinates.

The semantics are changed slightly: the menu actions
now operate on the clicked item, not on the selection.

Still to do: Fix up keyboard activation.

3 years agofilesystemmodel: Drop the model types
Matthias Clasen [Wed, 12 Oct 2022 12:18:39 +0000 (08:18 -0400)]
filesystemmodel: Drop the model types

We are no longer storing extra values, so no need
to take their types in the api.

3 years agofilesystemmodel: Drop unused arguments
Matthias Clasen [Wed, 12 Oct 2022 11:54:00 +0000 (07:54 -0400)]
filesystemmodel: Drop unused arguments

Drop the unused get_func arguments in constructors.

Update all callers.

3 years agofilechooserentry: Simplify model construction
Matthias Clasen [Wed, 12 Oct 2022 11:44:45 +0000 (07:44 -0400)]
filechooserentry: Simplify model construction

Don't pass a get_value callback when creating the
filesystem model. It isn't called anymore, and things
continue to work.

3 years agofilesystemmodel: Drop more unused api
Matthias Clasen [Wed, 12 Oct 2022 04:38:42 +0000 (00:38 -0400)]
filesystemmodel: Drop more unused api

Drop all apis that operate on tree iters.
We are no longer a tree model.

3 years agofilesystemmodel: Drop _gtk_file_system_model_get_value
Matthias Clasen [Wed, 12 Oct 2022 04:34:18 +0000 (00:34 -0400)]
filesystemmodel: Drop _gtk_file_system_model_get_value

This function is unused, so drop it, and its callback.

3 years agofilechooser: Some work on popup menus
Matthias Clasen [Wed, 12 Oct 2022 04:24:15 +0000 (00:24 -0400)]
filechooser: Some work on popup menus

This is a start towards placing menus properly.

We once again center keyboard-triggered menus
on the file list.

3 years agofilechooser: Drop deprecated includes
Matthias Clasen [Wed, 12 Oct 2022 04:07:31 +0000 (00:07 -0400)]
filechooser: Drop deprecated includes

We no longer use cell renderers and tree models
here. Yay.

3 years agofilesystemmodel: Fix a possible problem
Matthias Clasen [Wed, 12 Oct 2022 03:32:35 +0000 (23:32 -0400)]
filesystemmodel: Fix a possible problem

If the async query fails to reproduce a file info,
we still need to thaw the model, otherwise it ends
up frozen forever.

This was deduced by reading the code, I haven't
actually seen it happen.

3 years agofilechooserwidget: Use a string sorter for names
Matthias Clasen [Wed, 12 Oct 2022 03:30:43 +0000 (23:30 -0400)]
filechooserwidget: Use a string sorter for names

We can use the new collation property of GtkStringSorter,
and get the benefit of sort key caching. This commit
also fixes an accidental leak of all sorters, and
removes the sorter from the location column - we never
show that column when individual colummns are sortable.

3 years agofilechooser: Drop unnecessary theme tracking
Matthias Clasen [Tue, 11 Oct 2022 15:30:36 +0000 (11:30 -0400)]
filechooser: Drop unnecessary theme tracking

The widgets we are using handle theme changes
themselves, so there is no need for the filechooser
to do anything.

3 years agofilechooser: Bring back sorting
Matthias Clasen [Tue, 11 Oct 2022 15:02:07 +0000 (11:02 -0400)]
filechooser: Bring back sorting

Add a sort model between the filter model and the
file system model, and set it up to sort according
to the circumstances.

3 years agofilechooserwidget: Reimplement DnD Drop Target
Corey Berla [Tue, 11 Oct 2022 04:20:07 +0000 (21:20 -0700)]
filechooserwidget: Reimplement DnD Drop Target

This reverts commit 34752a15a71597d00a8d08befc545ac1c178b81b.

Leaving out the drag source portion as that needs a total
reimplementation.  The GtkDropTarget only required minor
modifications.

3 years agofilechooserwidget: Reinstate show_and_select_files
Matthias Clasen [Tue, 11 Oct 2022 02:36:35 +0000 (22:36 -0400)]
filechooserwidget: Reinstate show_and_select_files

Now that we have information about visible and
filtered-out status of items, we can make this
function work again.

3 years agofilechooserwidget: Add a filter model
Matthias Clasen [Tue, 11 Oct 2022 02:21:39 +0000 (22:21 -0400)]
filechooserwidget: Add a filter model

Put a filter model between the selection model and
the filesystem model, and make it filter on the
filechooser::visible attribute. This makes the filer
combo in the filterchooser and the 'show hidden files'
item work. But we need to prod the filter to trigger
a refiltering every now and then.

3 years agofilesystemmodel: Make filtering info available
Matthias Clasen [Tue, 11 Oct 2022 02:19:40 +0000 (22:19 -0400)]
filesystemmodel: Make filtering info available

Provide the filtered-out and visible bits as a file attributes
under the names filechooser::filtered-out and filechooser::visible,
so that we can filter on it.

3 years agofilechooserwidget: Connect to the right model
Georges Basile Stavracas Neto [Tue, 11 Oct 2022 02:19:14 +0000 (23:19 -0300)]
filechooserwidget: Connect to the right model

When recreating the browse_files_model model, connect to that
model's item-changed signal, instead of connecting to the selection
model.

3 years agofilechooserwidget: Connect to items-changed when changing model
Georges Basile Stavracas Neto [Tue, 11 Oct 2022 02:18:00 +0000 (23:18 -0300)]
filechooserwidget: Connect to items-changed when changing model

Just like previous commit, we need to call list_items_changed()
even if we change from single selection to multi selection or
vice-versa.