gtk4.git
3 years agofilechooserwidget: Compare focus against column view
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 17:49:35 +0000 (14:49 -0300)]
filechooserwidget: Compare focus against column view

This effectively doesn't work, but focus will be reworked at some
point, and this gets us a tiny bit closer to that.

3 years agogtkfilechooserwidget: Don't set size request
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 17:11:53 +0000 (14:11 -0300)]
gtkfilechooserwidget: Don't set size request

3 years agofilesystemmodel: Don't implement GtkTreeDragSource
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 15:32:48 +0000 (12:32 -0300)]
filesystemmodel: Don't implement GtkTreeDragSource

3 years agofilechooserwidget: Remove DnD code
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 15:32:19 +0000 (12:32 -0300)]
filechooserwidget: Remove DnD code

Another case where we'll reimplement it later.

3 years agofilesystemmodel: Drop GtkTreeSortable interface
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 15:25:10 +0000 (12:25 -0300)]
filesystemmodel: Drop GtkTreeSortable interface

Stop implementing this interface. We'll be able to reimplement
sorting once we fully transition to GListModel.

3 years agofilechooserwidget: Remove sorting
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 15:11:51 +0000 (12:11 -0300)]
filechooserwidget: Remove sorting

This will be reimplemented later using list models. For now, let's
remove it so we can untangle all this code properly.

3 years agofilechooserwidget: Stop autosizing treeview
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 15:10:55 +0000 (12:10 -0300)]
filechooserwidget: Stop autosizing treeview

3 years agofilechooserwidget: Use column view scrolled window
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 15:04:25 +0000 (12:04 -0300)]
filechooserwidget: Use column view scrolled window

One less hook to treeview widgetry.

3 years agofilechooserwidget: Move tooltip text to column view
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 15:02:20 +0000 (12:02 -0300)]
filechooserwidget: Move tooltip text to column view

Use a closure binding to query the tooltip.

3 years agofilechooserwidget: Move folder navigation to column view
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 13:51:14 +0000 (10:51 -0300)]
filechooserwidget: Move folder navigation to column view

React to column view's 'activate' signal, instead of treeview's
'row-activated'. It doesn't handle file sensitivity yet, but that
will probably be dropped later.

3 years agofilechooserwidget: Move keynav handling to column view
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 13:24:04 +0000 (10:24 -0300)]
filechooserwidget: Move keynav handling to column view

3 years agofilechooserwidget: Set rubberbanding on column view
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 13:20:14 +0000 (10:20 -0300)]
filechooserwidget: Set rubberbanding on column view

And stop setting it on the tree view.

3 years agofilesystemmodel: Don't expose cache
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 13:12:41 +0000 (10:12 -0300)]
filesystemmodel: Don't expose cache

With this commit we start slowly cleaning up the sattelite code
surrounding GtkFileChooserWidget, so that we eventually drop it
all.

3 years agofilechooserwidget: Remove extra action bar
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 13:09:42 +0000 (10:09 -0300)]
filechooserwidget: Remove extra action bar

3 years agofilechooserwidget: Move date and time to column view
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 13:03:05 +0000 (10:03 -0300)]
filechooserwidget: Move date and time to column view

Because this is the last treeview column, some pending tasks
are marked as TODO. We're getting close to dropping the tree
view!

3 years agofilechooserwidget: Move file type to column view
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 12:29:15 +0000 (09:29 -0300)]
filechooserwidget: Move file type to column view

3 years agofilechooserwidget: Move size to column view
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 12:13:01 +0000 (09:13 -0300)]
filechooserwidget: Move size to column view

This was one of the easier ones. We merely delegate the hard work
to g_format_size(), like we already do for treeview.

3 years agofilechooserwidget: Move location to column view
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 12:01:42 +0000 (09:01 -0300)]
filechooserwidget: Move location to column view

Move the entire location column, which only contains the location
renderer, to the column view. The code to generate locations from
the current folder is essentially intact.

3 years agofilechooserwidget: Drop name column from treeview
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 11:22:53 +0000 (08:22 -0300)]
filechooserwidget: Drop name column from treeview

It is now entirely handled by the column view.

3 years agofilechooserwidget: Move file icon to column view
Georges Basile Stavracas Neto [Sat, 8 Oct 2022 11:15:09 +0000 (08:15 -0300)]
filechooserwidget: Move file icon to column view

This commit moves the icon loading code into a new private
widget called GtkFileThumbnail, which is bound to the GFileInfo
of the model, and asynchronously loads the file icon from that.

3 years agofilechooserwidget: Move file name to column view
Georges Basile Stavracas Neto [Fri, 7 Oct 2022 21:11:06 +0000 (18:11 -0300)]
filechooserwidget: Move file name to column view

And remove it from the tree view. Next commits will look a lot like
this, until all columns are moved.

3 years agofilechooserwidget: Replace 'list' page with column view
Georges Basile Stavracas Neto [Fri, 7 Oct 2022 20:48:26 +0000 (17:48 -0300)]
filechooserwidget: Replace 'list' page with column view

Replace the 'list' page of the main stack with another page, this
one containing a GtkColumnView. This, again, is the very minimal
code to achieve a column view - and validate the GListModel code
introduced in the previous commit - but there's a long way until
this column view covers the full range of features of the file
chooser.

The tree view still lives in an unused 'list2' page. From now on,
commits will "cannibalize" the treeview, each commit porting any
particular feature - be it a column, an event controller, etc -
to the column view, and dropping the corresponding feature from
the treeview.

3 years agofilesystemmodel: Implement GListModel
Georges Basile Stavracas Neto [Fri, 7 Oct 2022 19:52:56 +0000 (16:52 -0300)]
filesystemmodel: Implement GListModel

This is a trivial implementation of the GListModel interface. It
does not do anything fancy, like filtering out hidden files, nor
sorting.

The purpose of this minimal implementation is to bootstrap the
initial work to port GtkFileChooserWidget to GtkColumnView.

3 years agofilesystemmodel: Use g_clear_* on finalize
Georges Basile Stavracas Neto [Fri, 7 Oct 2022 20:12:05 +0000 (17:12 -0300)]
filesystemmodel: Use g_clear_* on finalize

Trivial cleanup, no functional changes.

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

inspector: Fix accessibility calls

See merge request GNOME/gtk!5154

3 years agoMerge branch 'completion' into 'main'
Matthias Clasen [Fri, 21 Oct 2022 02:13:42 +0000 (02:13 +0000)]
Merge branch 'completion' into 'main'

entrycompletion: Fix inserted-text handler

See merge request GNOME/gtk!4892

3 years agofilechooserentry: Fix completions
Matthias Clasen [Fri, 21 Oct 2022 01:41:18 +0000 (21:41 -0400)]
filechooserentry: Fix completions

Before we can drop them, lets make them work.

This was broken since 4.0, I assume :(

3 years agoinspector: Fix accessibility calls
Matthias Clasen [Fri, 21 Oct 2022 01:13:46 +0000 (21:13 -0400)]
inspector: Fix accessibility calls

The argument list of gtk_accessible_update_property
is -1-terminated, not NULL-terminated.

3 years agoMerge branch 'columnview-sorter-api' into 'main'
Matthias Clasen [Thu, 20 Oct 2022 19:18:26 +0000 (19:18 +0000)]
Merge branch 'columnview-sorter-api' into 'main'

gtk-demo: Add more sort columns

Closes #5149

See merge request GNOME/gtk!5152

3 years agoMerge branch 'fix-wayland-keycode-mapping' into 'main'
Matthias Clasen [Thu, 20 Oct 2022 19:15:38 +0000 (19:15 +0000)]
Merge branch 'fix-wayland-keycode-mapping' into 'main'

wayland: Fix keycode->keyval mapping

Closes #5277

See merge request GNOME/gtk!5147

3 years agoMerge branch 'ebassi/tree-deprecation-docs' into 'main'
Matthias Clasen [Thu, 20 Oct 2022 18:39:29 +0000 (18:39 +0000)]
Merge branch 'ebassi/tree-deprecation-docs' into 'main'

docs: Add deprecation messages to GtkTreeStore

See merge request GNOME/gtk!5115

3 years agoMerge branch 'wip/jtojnar/compose-consistent-system' into 'main'
Matthias Clasen [Thu, 20 Oct 2022 18:28:47 +0000 (18:28 +0000)]
Merge branch 'wip/jtojnar/compose-consistent-system' into 'main'

Improve composetable inclusions

See merge request GNOME/gtk!5150

3 years agocolumnviewtitle: Clean up interactions
Matthias Clasen [Thu, 20 Oct 2022 17:37:26 +0000 (13:37 -0400)]
columnviewtitle: Clean up interactions

Separate the apis we use for updating title,
menu and sort indicator.

3 years agocolumnviewsorter: Add public API
Matthias Clasen [Thu, 20 Oct 2022 14:33:57 +0000 (10:33 -0400)]
columnviewsorter: Add public API

This API should be sufficient to serialize
a columnviews sort configuration.

Fixes: #5149
3 years agoMake GtkColumnViewSorter public
Matthias Clasen [Thu, 20 Oct 2022 14:05:13 +0000 (10:05 -0400)]
Make GtkColumnViewSorter public

API is yet to come.

3 years agocolumnviewsorter: Cosmetics
Matthias Clasen [Thu, 20 Oct 2022 13:59:28 +0000 (09:59 -0400)]
columnviewsorter: Cosmetics

3 years agocolumnviewcolumn: Add an ID
Matthias Clasen [Thu, 20 Oct 2022 13:50:14 +0000 (09:50 -0400)]
columnviewcolumn: Add an ID

This string can be used when storing columnview
configuration.

3 years agocolumnviewcolumn: Remove some unused code
Matthias Clasen [Thu, 20 Oct 2022 13:52:54 +0000 (09:52 -0400)]
columnviewcolumn: Remove some unused code

3 years agocolumnviewcolumn: Cosmetics
Matthias Clasen [Thu, 20 Oct 2022 13:40:39 +0000 (09:40 -0400)]
columnviewcolumn: Cosmetics

3 years agogtk-demo: Add more sort columns
Matthias Clasen [Thu, 20 Oct 2022 15:38:40 +0000 (11:38 -0400)]
gtk-demo: Add more sort columns

Add a second sort column to the Settings demo,
to make it easier to test column view sorting.

3 years agoAdd more messages to the deprecation warnings
Emmanuele Bassi [Thu, 20 Oct 2022 11:42:27 +0000 (12:42 +0100)]
Add more messages to the deprecation warnings

Point to replacement types for the old GtkTree* API.

3 years agoMark GtkStyleContext type as deprecated
Emmanuele Bassi [Thu, 20 Oct 2022 11:36:32 +0000 (12:36 +0100)]
Mark GtkStyleContext type as deprecated

Add the Deprecated tag to the type docblock

3 years agoMark GtkEntryCompletion type as deprecated
Emmanuele Bassi [Thu, 20 Oct 2022 11:36:08 +0000 (12:36 +0100)]
Mark GtkEntryCompletion type as deprecated

Add the Deprecated tag to the type docblock.

3 years agoMark GtkTreeView-related types as deprecated
Emmanuele Bassi [Thu, 20 Oct 2022 11:35:31 +0000 (12:35 +0100)]
Mark GtkTreeView-related types as deprecated

Add the Deprecated annotation to the type docblock.

3 years agoimcontextsimple: Document that Compose file support is incomplete
Jan Tojnar [Thu, 20 Oct 2022 14:19:13 +0000 (16:19 +0200)]
imcontextsimple: Document that Compose file support is incomplete

And that `include "%L"` does something different as introduced in
https://gitlab.gnome.org/GNOME/gtk/-/commit/3b4b1c68781aad61fc6b91c9dff75b5790b4d8e4

Note that user can still use `include "/.%L"` as a workaround.

3 years agoMark GtkAppChooser-related types as deprecated
Emmanuele Bassi [Thu, 20 Oct 2022 11:23:58 +0000 (12:23 +0100)]
Mark GtkAppChooser-related types as deprecated

The type docblock needs a Deprecated annotation.

3 years agoMark GtkCellRenderer-related types as deprecated
Emmanuele Bassi [Thu, 20 Oct 2022 11:23:13 +0000 (12:23 +0100)]
Mark GtkCellRenderer-related types as deprecated

The docblock for the type needs a Deprecated annotation, and we can use
it to point to the appropriate replacement.

3 years agoPoint at the replacement for GtkIconView
Emmanuele Bassi [Thu, 20 Oct 2022 10:38:11 +0000 (11:38 +0100)]
Point at the replacement for GtkIconView

In the symbol annotations and in the docblocks.

3 years agoPoint at the replacements for GtkTreeView
Emmanuele Bassi [Thu, 20 Oct 2022 10:37:23 +0000 (11:37 +0100)]
Point at the replacements for GtkTreeView

In the symbol annotations and in the docblocks.

3 years agoPoint to replacement for GtkComboBoxText
Emmanuele Bassi [Thu, 20 Oct 2022 10:11:41 +0000 (11:11 +0100)]
Point to replacement for GtkComboBoxText

GtkDropDown and GtkStringList replace GtkComboBoxText with a simpler
API.

3 years agocomposetable: Support non-FHS paths for Compose tables
Jan Tojnar [Thu, 20 Oct 2022 10:59:17 +0000 (12:59 +0200)]
composetable: Support non-FHS paths for Compose tables

On platforms like NixOS, the libX11 installation prefix may differ from /usr/share,
breaking the hardcoded placeholders. Let’s re-use the X11 path definition from imcontextsimple.

3 years agoPoint to GtkDropDown as the GtkComboBox replacement
Emmanuele Bassi [Thu, 20 Oct 2022 10:10:57 +0000 (11:10 +0100)]
Point to GtkDropDown as the GtkComboBox replacement

3 years agodocs: Add deprecation message for GtkListStore
Emmanuele Bassi [Wed, 12 Oct 2022 23:06:12 +0000 (00:06 +0100)]
docs: Add deprecation message for GtkListStore

Point to GListStore and list models instead.

3 years agodocs: Add deprecation messages to GtkTreeStore
Emmanuele Bassi [Wed, 12 Oct 2022 22:48:38 +0000 (23:48 +0100)]
docs: Add deprecation messages to GtkTreeStore

Point to GtkTreeListModel, and while we're at it, let's fix some of the
gtk-doc-isms that are still there.

3 years agoMerge branch 'label-selection-fix' into 'main'
Matthias Clasen [Wed, 19 Oct 2022 21:37:08 +0000 (21:37 +0000)]
Merge branch 'label-selection-fix' into 'main'

label: Tweak selection behavior

Closes #2024

See merge request GNOME/gtk!5148

3 years agolabel: Tweak selection behavior
Matthias Clasen [Wed, 19 Oct 2022 20:21:36 +0000 (16:21 -0400)]
label: Tweak selection behavior

Arrange for double-click-followed-by-drag to do
select by words, not select-and-dnd. This matches
the behavior in GtkTextView better and feels
intuitive.

Fixes: #2024
3 years agowayland: Fix keycode->keyval mapping
Matthias Clasen [Wed, 19 Oct 2022 19:35:12 +0000 (15:35 -0400)]
wayland: Fix keycode->keyval mapping

We were looping over the levels, but not using
the current level value to obtain the keymap
entries. Oops.

Fixes: #5277
3 years agoMerge branch 'filechooser-amberol' into 'main'
Matthias Clasen [Wed, 19 Oct 2022 19:41:15 +0000 (19:41 +0000)]
Merge branch 'filechooser-amberol' into 'main'

filechooser: Improve "Open in File Manager"

Closes #5260

See merge request GNOME/gtk!5140

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Wed, 19 Oct 2022 19:11:57 +0000 (19:11 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

docs: Remove mention of ~/.gtk-4.0

Closes #3266

See merge request GNOME/gtk!5146

3 years agofilechooser: Improve "Open in File Manager"
Matthias Clasen [Wed, 19 Oct 2022 05:51:19 +0000 (01:51 -0400)]
filechooser: Improve "Open in File Manager"

Just relying on GAppInfo leads to suboptimal
results. Instead, call either the OpenURI portal
or the org.freedesktop.FileManager1 interface
directly, and only fall back to GAppInfo.

The wrapper code for the OpenURI portal is taken
from gio, with small adjustments.

Fixes: #5260
3 years agodocs: Remove mention of ~/.gtk-4.0
Matthias Clasen [Wed, 19 Oct 2022 18:32:23 +0000 (14:32 -0400)]
docs: Remove mention of ~/.gtk-4.0

We are not looking there anymore, for a long time.

Fixes: #3266
3 years agoMerge branch 'builder-tool-scope' into 'main'
Matthias Clasen [Wed, 19 Oct 2022 18:34:25 +0000 (18:34 +0000)]
Merge branch 'builder-tool-scope' into 'main'

docs: Update gtk4-builder-tool docs

See merge request GNOME/gtk!5145

3 years agodocs: Document new buildertool options
Matthias Clasen [Wed, 19 Oct 2022 16:31:53 +0000 (12:31 -0400)]
docs: Document new buildertool options

3 years agobuildertool: Support enumerating callbacks
Matthias Clasen [Wed, 19 Oct 2022 16:29:39 +0000 (12:29 -0400)]
buildertool: Support enumerating callbacks

The new scope approach makes this easy, and
it can be useful to know what functions are
needed.

3 years agobuildertool: Improve validate implementation
Matthias Clasen [Wed, 19 Oct 2022 15:41:35 +0000 (11:41 -0400)]
buildertool: Improve validate implementation

Reimplement deprecation checking via a scope.
This lets us ignore missing callbacks, and helps
for validating templates.

3 years agobuildertool: Add a builder scope implementation
Matthias Clasen [Wed, 19 Oct 2022 16:13:29 +0000 (12:13 -0400)]
buildertool: Add a builder scope implementation

This will be used in future commits.

3 years agobuildertool: Use --deprecations for templates
Matthias Clasen [Wed, 19 Oct 2022 14:30:36 +0000 (10:30 -0400)]
buildertool: Use --deprecations for templates

Use this option for templates too.

We still can't parse most templates, since they are
missing their callbacks.

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Wed, 19 Oct 2022 17:13:23 +0000 (17:13 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

docs: Update gtk4-builder-tool docs

See merge request GNOME/gtk!5144

3 years agoMerge branch 'wip/clipboard-serials' into 'main'
Matthias Clasen [Wed, 19 Oct 2022 13:57:19 +0000 (13:57 +0000)]
Merge branch 'wip/clipboard-serials' into 'main'

gdk/wayland: Use serial of the latest implicit grab available

Closes #5250

See merge request GNOME/gtk!5143

3 years agodocs: Update gtk4-builder-tool docs
Matthias Clasen [Wed, 19 Oct 2022 12:50:34 +0000 (08:50 -0400)]
docs: Update gtk4-builder-tool docs

Mention the new --deprecations option of the
validate command.

3 years agogdk/wayland: Use serial of the latest implicit grab available
Carlos Garnacho [Wed, 19 Oct 2022 10:46:09 +0000 (12:46 +0200)]
gdk/wayland: Use serial of the latest implicit grab available

When getting the serial for primary/clipboard selections we used a
function that largely relied on a GdkEvent being passed. We have
another available function that looks up the most recent serial
given the ongoing touch/tablet input as well.

This is the second best, compared to actually knowing the
input/device from the event that was received by the UI an triggered
the clipboard operation, and is already in use in other places
(e.g. window dragging). It is valid for these situations too.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5250
3 years agoMerge branch 'builder-deprecations' into 'main'
Matthias Clasen [Wed, 19 Oct 2022 11:20:37 +0000 (11:20 +0000)]
Merge branch 'builder-deprecations' into 'main'

buildertool: Fix template handling

Closes #5256

See merge request GNOME/gtk!5141

3 years agobuildertool: Warn about deprecations
Matthias Clasen [Wed, 19 Oct 2022 06:46:52 +0000 (02:46 -0400)]
buildertool: Warn about deprecations

Add a new option --deprecations to the validate
command that will warn about use of deprecated types.

The list of current deprecations is unfortunately
hardcoded in the source, so this list will have to
be kept up-to-date.

Fixes: #5256
3 years agobuildertool: Fix template handling
Matthias Clasen [Wed, 19 Oct 2022 06:40:10 +0000 (02:40 -0400)]
buildertool: Fix template handling

We were not properly parsing the error message
here, leading to badness.

3 years agoMerge branch 'text-overwrite-undo' into 'main'
Matthias Clasen [Wed, 19 Oct 2022 05:59:13 +0000 (05:59 +0000)]
Merge branch 'text-overwrite-undo' into 'main'

testsuite: Fix tiff pixbuf tests

Closes #4411

See merge request GNOME/gtk!5138

3 years agoMerge branch 'clarify-gapplication-docs' into 'main'
Matthias Clasen [Wed, 19 Oct 2022 03:54:36 +0000 (03:54 +0000)]
Merge branch 'clarify-gapplication-docs' into 'main'

docs: Clarify a point in GtkApplication docs

See merge request GNOME/gtk!5139

3 years agoMerge branch 'fix-pixbuf-tiff-tests' into 'main'
Matthias Clasen [Wed, 19 Oct 2022 03:53:08 +0000 (03:53 +0000)]
Merge branch 'fix-pixbuf-tiff-tests' into 'main'

testsuite: Fix tiff pixbuf tests

Closes #4615

See merge request GNOME/gtk!5137

3 years agoMerge branch 'modelbutton-tooltip' into 'main'
Matthias Clasen [Wed, 19 Oct 2022 03:51:21 +0000 (03:51 +0000)]
Merge branch 'modelbutton-tooltip' into 'main'

widgetfactory: Add text to iconic model buttons

Closes #5220

See merge request GNOME/gtk!5136

3 years agotext: Make overwrite undo-friendly
Matthias Clasen [Wed, 19 Oct 2022 03:37:03 +0000 (23:37 -0400)]
text: Make overwrite undo-friendly

In overwrite mode, every typed character gets
handled as a delete+insert, but we should not
record these as two individually undoable
steps.

This matches how we handle overwrite mode in
GtkTextView.

Fixes: #4411
3 years agodocs: Clarify a point in GtkApplication docs
Matthias Clasen [Wed, 19 Oct 2022 03:47:48 +0000 (23:47 -0400)]
docs: Clarify a point in GtkApplication docs

Clarify that loading of automatic resources uses
the resource base path that was set at construction
time.

Fixes: #4300
3 years agotestsuite: Skip known-broken tests
Matthias Clasen [Wed, 19 Oct 2022 03:22:15 +0000 (23:22 -0400)]
testsuite: Skip known-broken tests

The tiff pixbuf tests fail because of known
issues with the pixbuf tiff loader. Skip them.

Fixes: #4615
3 years agotestsuite: Fix tiff pixbuf tests
Matthias Clasen [Wed, 19 Oct 2022 03:21:28 +0000 (23:21 -0400)]
testsuite: Fix tiff pixbuf tests

This test wasn't actually testing what it claims,
since that functionality is broken in gdk-pixbuf.

Test it anyway.

3 years agomodelbutton: Set up tooltips
Matthias Clasen [Wed, 19 Oct 2022 02:35:28 +0000 (22:35 -0400)]
modelbutton: Set up tooltips

Use the text of iconic model buttons as tooltip.

Fixes: #5220
3 years agowidgetfactory: Add text to iconic model buttons
Matthias Clasen [Wed, 19 Oct 2022 02:35:02 +0000 (22:35 -0400)]
widgetfactory: Add text to iconic model buttons

We want to use this for tooltips in the future.

3 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Wed, 19 Oct 2022 01:53:56 +0000 (01:53 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

fontchooser: Drop a few errant translations

Closes #5146

See merge request GNOME/gtk!5135

3 years agofontchooser: Drop a few errant translations
Matthias Clasen [Tue, 18 Oct 2022 20:40:37 +0000 (16:40 -0400)]
fontchooser: Drop a few errant translations

No point in translating these properties, they
are not strings.

Fixes: #5146
3 years agoMerge branch 'fix-editable-label-spurious-focus-out' into 'main'
Matthias Clasen [Tue, 18 Oct 2022 19:45:19 +0000 (19:45 +0000)]
Merge branch 'fix-editable-label-spurious-focus-out' into 'main'

window: Keep a reference to move_focus_widget

Closes #4864

See merge request GNOME/gtk!5134

3 years agoeditablelabel: Defer changes on focus-out
Matthias Clasen [Tue, 18 Oct 2022 18:23:22 +0000 (14:23 -0400)]
editablelabel: Defer changes on focus-out

We can get spurious focus-out/-in pairs when
the editable label is in a popover that gets
a Wayland keyboard enter event as a result of
clicking the editable label.

A timeout isn't a great solution, but nothing
better is available right now.

Fixes: #4864
3 years agowindow: Keep a reference to move_focus_widget
Matthias Clasen [Tue, 18 Oct 2022 18:21:51 +0000 (14:21 -0400)]
window: Keep a reference to move_focus_widget

If we don't take a reference, it can happen that
the pointer is no longer valid by the time we
dereference it in after_paint.

3 years agoMerge branch 'fix-focus-changes' into 'main'
Matthias Clasen [Tue, 18 Oct 2022 11:02:08 +0000 (11:02 +0000)]
Merge branch 'fix-focus-changes' into 'main'

window: Fix focus updates

Closes #4903

See merge request GNOME/gtk!5127

3 years agoMerge branch 'fix-windows-build-testmountoperation' into 'main'
Matthias Clasen [Tue, 18 Oct 2022 10:53:21 +0000 (10:53 +0000)]
Merge branch 'fix-windows-build-testmountoperation' into 'main'

tests/testmountoperation.c: Fix build on Windows

See merge request GNOME/gtk!5126

3 years agowindow: Don't focus invisible widgets
Matthias Clasen [Mon, 17 Oct 2022 19:10:51 +0000 (15:10 -0400)]
window: Don't focus invisible widgets

Only clear a queued move_focus if the widget
we are focusing is actually visible.

This was happening in some cases when popovers
are dismissed by clicking outside, and it was
causing us to miss proper focus updates that
were already queued.

3 years agoMerge branch 'bilelmoussaoui/gi-deprecated' into 'main'
Benjamin Otte [Tue, 18 Oct 2022 09:53:53 +0000 (09:53 +0000)]
Merge branch 'bilelmoussaoui/gi-deprecated' into 'main'

g-i: Fix deprecated version of GtkTreeView

See merge request GNOME/gtk!5131

3 years agog-i: Fix deprecated version of GtkTreeView
Bilal Elmoussaoui [Tue, 18 Oct 2022 09:25:56 +0000 (11:25 +0200)]
g-i: Fix deprecated version of GtkTreeView

3 years agoMerge branch 'forward-port-mr-991-to-gtk4-2' into 'main'
Luca Bacci [Mon, 17 Oct 2022 19:20:08 +0000 (19:20 +0000)]
Merge branch 'forward-port-mr-991-to-gtk4-2' into 'main'

Use native Windows API for converting keystrokes to characters

Closes #2944

See merge request GNOME/gtk!4986

3 years agowindow: Fix focus updates
Matthias Clasen [Mon, 17 Oct 2022 16:29:44 +0000 (12:29 -0400)]
window: Fix focus updates

This partially undoes changes from 3dbf5038fab8eb0.

That commit did two things:
1) Move the focus update to after-paint time
2) Change from grabbing focus to the visible parent
   to  calling move_focus (TAB)

The second part did have the unintended consequence
of moving focus laterally.

Fixes: #4903
3 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Mon, 17 Oct 2022 18:34:40 +0000 (18:34 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

singleselection: Be more careful about notifies

See merge request GNOME/gtk!5129

3 years agodropdown: Handle ::selected and ::selected-item separately
Benjamin Otte [Mon, 17 Oct 2022 18:07:51 +0000 (20:07 +0200)]
dropdown: Handle ::selected and ::selected-item separately

GtkSingleSelection will only emit either of those signals if they
change. But it is possible that only one of those properties changes,
and in those cases we want to only notify for that property changing in
the dropdown, too.

3 years agosingleselection: Be more careful about notifies
Benjamin Otte [Mon, 17 Oct 2022 17:54:40 +0000 (19:54 +0200)]
singleselection: Be more careful about notifies

We don't want to notify::selected or notify::selected-item if they
didn't change.
This will bring performance benefits on frequently changing lists.

In particular, if lists get filtered or reordered, but the selected item
stays in the list, not doing a notify::selected-item will avoid updates
in connected handlers like GtkDropdown (and its handlers), thereby
avoiding lots of unnecessary updates.

3 years agoUse native Windows API for converting keystrokes to characters
Philip Zander [Wed, 24 Aug 2022 11:21:10 +0000 (13:21 +0200)]
Use native Windows API for converting keystrokes to characters