Commit Graph

35451 Commits

Author SHA1 Message Date
Benjamin Otte
ad60efb5d7 expression: Invalidate bindings before destroying them
Use a weak ref to invalidate bindings. Make sure that this happens
before creating any watches, so that notifies from the
watched expression about changes will not trigger set_property() calls
during dispose()/finalize().

Invalidating also ensures that the watches aren't removed, which can
trigger warnings if the watches are watching the object itself, and the
weak refs cannot be removed anymore.
2020-05-30 17:48:44 -04:00
Benjamin Otte
b7efe4eb4f expression: Add gtk_expression_bind()
Add a simple way to bind expressions to object properties. This is
essentially the thing to replace g_object_bind_property().
2020-05-30 17:48:44 -04:00
Benjamin Otte
ec742f9373 expression: Add the ability to watch an expression 2020-05-30 17:48:44 -04:00
Benjamin Otte
fde75aa9f6 builder: Add support for parsing expressions 2020-05-30 17:47:47 -04:00
Benjamin Otte
22659afd00 Add GtkMultiFilter, GtkAnyFilter, GtkEveryFilter
GtkMultiFilter is the abstract base class for managing multiple child
filter.
GtkAnyFilter and GtkEveryFilter are the actual implementations.
2020-05-30 17:42:09 -04:00
Benjamin Otte
410e7dcf5d filter: Add GtkStringFilter
Users provide a search filter and an expression that evaluates the items
to a string and then the filter goes and matches those strings to the
search term.
2020-05-30 17:42:09 -04:00
Benjamin Otte
bd8655fdee expression: Add GtkObjectExpression
Weak refs break cycles...
2020-05-30 17:42:09 -04:00
Benjamin Otte
e9f1ee5aab Add GtkExpression
GtkExpressions allow looking up values from objects.

There are a few simple expressions, but the main one is the closure
expression that just calls a user-provided closure.
2020-05-30 17:42:08 -04:00
Benjamin Otte
4abdf695e3 filterlistmodel: Rewrite to use GtkFilter 2020-05-30 12:30:23 -04:00
Benjamin Otte
1ab081b584 Add GtkCustomFilter 2020-05-30 12:30:23 -04:00
Benjamin Otte
1df17f2fea Add GtkFilter 2020-05-30 12:30:23 -04:00
Benjamin Otte
682e97826c Add GtkDirectoryList
Adds a new listmodel called GtkDirectoryList that lists the children of
a GFile as GFileInfos.

This is supposed to be used by the filechooser.
2020-05-30 12:30:23 -04:00
Benjamin Otte
805fea20cb eventcontrollermotion: Remove mode argument
It's not used and nobody has documented how it's meant to work anyway.
2020-05-30 12:30:23 -04:00
Matthias Clasen
2f20a40922 Merge branch 'matthiasc/for-master' into 'master'
Some listview preparations

See merge request GNOME/gtk!1988
2020-05-30 15:51:21 +00:00
Matthias Clasen
bb7f6ed544 Merge branch 'fix-gesture-leak' into 'master'
gesture: Don't leak target widgets

Closes #2801

See merge request GNOME/gtk!1986
2020-05-30 15:12:05 +00:00
Benjamin Otte
f1d6a0a4ed widget: Add gtk_widget_get_size()
A little bit of convenience.
2020-05-30 10:48:02 -04:00
Benjamin Otte
1ef805328f builder: Allow <property bind /> for objects
Previously, object properties had to always be set to a value.
This now works without it.
2020-05-30 10:46:27 -04:00
Matthias Clasen
3a8ebf4c9f Merge branch 'wip/jimmac/backdrop-assasination' into 'master'
Adwaita: limit scope of :backdrop

Closes #2694

See merge request GNOME/gtk!1978
2020-05-30 14:41:52 +00:00
Matthias Clasen
0d69c42320 gesture: Don't leak target widgets
This was broken when we started tracking event targets
in dcbecdac31.

Fixes: #2801
2020-05-30 09:47:24 -04:00
Matthias Clasen
66120cff4b eventcontroller: Fix crossing event scopes
We want to deliver crossing events to controllers
with scope same-native as long as at least one of
the targets is on the same native. As a new approach,
treat out-of-scope targets like NULL, and deliver
crossing events as long as one of the targets is
not NULL.
2020-05-29 19:41:39 -04:00
Matthias Clasen
8ce1034e87 Add GTK_DEBUG=shortcuts
If the shortcuts debug flag is set, print out
shortcut activations.
2020-05-29 17:59:58 -04:00
Jakub Steiner
f4705bab1e Adwaita: limit scope of :backdrop
- most controls don't have:backdrop state
- different :backdrop state reserved for windows, headebars and toolbars
  and some buttons

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2694
2020-05-29 12:43:13 +02:00
Matthias Clasen
506d73cf32 Add gtk_im_context_filter_key
An event-less variant of the filtering api.
2020-05-28 17:08:33 -04:00
Matthias Clasen
2d80b105ce shortcut controller: Fix mnemonic cycling
Iterate the shortcuts we found in order, not in
reverse. Otherwise, we always end up activating
the last_selected one, since it is last in the
list.

This broke in fb9b54d4b2 when a list was
turned into an array.
2020-05-28 08:52:55 -04:00
Yuri Chornoivan
01bd4cc4e1 Fix minor typos 2020-05-28 11:00:03 +03:00
Matthias Clasen
8e427b7d69 a11y: Widgets have children
This brings back some of what we lost when
GtkContainerAccessible went away.
2020-05-27 22:56:33 -04:00
Matthias Clasen
2c80691be6 aboutdialog: Stop overriding show()
This is entirely unnecessary.
2020-05-27 20:05:26 -04:00
Matthias Clasen
1cd71203b8 volumebutton: Enable the tooltips
Little point in having a query-tooltip handler if
we don't make sure ::query-tooltip is emitted.
2020-05-27 19:02:30 -04:00
Matthias Clasen
9c5fc0fb7a volumebutton: Remove broken a11y code
The accessible of a button is not an AtkImage,
so whatever this code was trying to do isn't
working. Remove it.
2020-05-27 19:02:19 -04:00
Matthias Clasen
1927a8af71 tooltips: Fix a line wrap mishap
We don't want wrapping labels to cause tooltips to
have excessive height, so we need to set a reasonable
value for width-chars, without forcing short tooltips
into a full line length. Also be careful to respect
preexisting line breaks (we have such examples in
widget factory).
2020-05-27 19:01:46 -04:00
Emmanuele Bassi
637186976c Remove spurious annotations
Boolean values are not nullable, and have no ownership to transfer.
2020-05-27 15:49:24 +01:00
Emmanuele Bassi
175d4ef03e Add missing documentation for GtkOverlayLayout
We're missing the documentation for the constructor, and for the child
properties.
2020-05-27 15:49:24 +01:00
Carlos Garcia Campos
a2aa25d28e build: add gtkoverlaylayout.h to the list of public headers
GtkOverlayLayout is now public but the header is not installed.
2020-05-27 11:13:02 +02:00
Matthias Clasen
efbc661620 window: Drop an unused field
The type-hint property is gone, and nothing reads
or writes the type_hint field anymore.
2020-05-26 19:30:26 -04:00
Matthias Clasen
5f9bcd0409 accelgroup: Expand translator comment
Add details about the use of KP.
2020-05-25 22:50:03 -04:00
Matthias Clasen
bd3f4599ed Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #2778

See merge request GNOME/gtk!1966
2020-05-26 02:41:37 +00:00
Matthias Clasen
ddf6138d07 Merge branch 'ebassi/for-master' into 'master'
Ebassi/for master

Closes #2783

See merge request GNOME/gtk!1962
2020-05-26 01:35:11 +00:00
Matthias Clasen
a55d179215 accelgroup: Drop some unused code 2020-05-25 20:56:09 -04:00
Matthias Clasen
0f096d6ad9 bitmask: add an assertion
The static analysis in ci is complaining about
this, since it doesn't know that start is always
smaller than end.
2020-05-25 20:56:09 -04:00
Matthias Clasen
9fa3742c09 Make GtkOverlayLayout public
Keeping the layout manager type private does not
really work when it has layout child properties
that need to be usable in ui files.
2020-05-25 14:22:10 -04:00
Timm Bäder
2127cc1943 adwaita: move backdrop box shadows to .csd
Fixes #2781
2020-05-25 10:36:29 +02:00
Emmanuele Bassi
7de9eb005e Add a comment for translators
"KP" refers to the numeric keypad, in this context.

Fixes: #2783
2020-05-24 15:20:13 +01:00
Emmanuele Bassi
d68e312c2b Use the private GdkKeyEvent.translated_key getter
We can avoid poking directly at the GdkKeyEvent structure, now.
2020-05-24 15:19:01 +01:00
Timm Bäder
60902484fd applicationwindow: Simplify measure implementation
We already chain up first thing in this function, so no need to do it
again.
2020-05-24 15:59:05 +02:00
Timm Bäder
48c9c86626 window: Remove private _get_shadow_width()
Unused now.
2020-05-24 15:59:05 +02:00
Timm Bäder
2e27a76edd applicationwindow: Stop querying shadow width
don't need to do this anymore.
2020-05-24 15:59:05 +02:00
Matthias Clasen
5e25ba6c5a Merge branch 'no-app-menu' into 'master'
Drop the app menu

Closes #2731

See merge request GNOME/gtk!1951
2020-05-22 23:46:56 +00:00
Matthias Clasen
0dc384265c Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!1957
2020-05-22 22:19:59 +00:00
Matthias Clasen
133461581f Merge branch 'BUG_filechooserbutton_remote_GTK4' into 'master'
FileChooserButton: query 'display name' also for unbookmarked files

Closes #1966

See merge request GNOME/gtk!1725
2020-05-22 21:37:40 +00:00
Matthias Clasen
79d6a77d58 gtkapplication: Drop app menu support
Drop apis and code related to appmenus from
both GtkApplication and GtkApplicationWindow.

We still keep the menubar support, since it
is needed for system integration on OS X.

Fixes: #2731
2020-05-22 17:31:05 -04:00