Emmanuele Bassi
d75fd59ddf
Allow installing bindings bound to actions
...
This is just convenience code around GtkShortcut, just like bindings for
signal emission and callback invocation.
2020-03-18 23:00:49 -04:00
Emmanuele Bassi
84a52e3bbd
shortcut: Add action activation
2020-03-18 23:00:49 -04:00
Emmanuele Bassi
9687d69b5a
bindings: Export action activation internally
...
We're going to use it, just like we use the signal emission code.
2020-03-18 23:00:49 -04:00
Benjamin Otte
b18f9da807
shortcut: Add gtk_shortcut_set_callback()
...
... and gtk_widget_class_add_binding() to go with it.
This allows shortcuts to invoke manually added callbacks.
2020-03-18 23:00:49 -04:00
Benjamin Otte
6c13bbb441
combobox: Port bindings to use shortcuts
2020-03-18 23:00:49 -04:00
Benjamin Otte
4f128a4a21
assistant: Port bindings to use shortcuts
2020-03-18 23:00:49 -04:00
Benjamin Otte
e62154c91f
trigger: Add an alternative trigger
...
And use it.
I just added it to GtkWidget just to show that I can.
The real reason I want it is for gamepad/joystick triggers
in games, so that it becomes possible to select 2 different
triggers (gamepad and keyboard) for the same shortcut.
2020-03-18 23:00:49 -04:00
Matthias Clasen
78f9940ddc
shortcut: Add GtkShortcutTrigger
...
Triggers are meant to describe how to trigger a shortcut.
So far only a keyval + modifiers trigger exists.
2020-03-18 23:00:49 -04:00
Benjamin Otte
0f6c5da28d
window: Port bindings to use shortcuts
2020-03-18 23:00:49 -04:00
Benjamin Otte
c7f10e570e
bindings: Add more variant types
...
Also marshal types that the code in gtkbindings.c doesn't use. These
will be used by gtk_widget_class_add_binding_signal().
2020-03-18 23:00:49 -04:00
Benjamin Otte
e19b49f5aa
widget: Add gtk_widget_class_add_shortcut()
...
This allows adding shortcuts as a replacement for keybindings.
2020-03-18 23:00:49 -04:00
Benjamin Otte
ff13ee4b66
gtk: Add GtkShortcut
...
This is the base class for what is about to take over all sorts of
keyboard shortcuts. The initial version barely deals with keybindings.
2020-03-18 23:00:49 -04:00
Benjamin Otte
fed7d3833f
bindings: Split out function to invoke an action signal
...
We want to use that in shortcuts later.
2020-03-18 23:00:49 -04:00
Benjamin Otte
5c6be5c0cd
shortcutcontroller: Introduce
...
This is a very barebones controller that currently does nothing but
activate the binding signals. Yay.
And because we have bindings on every widget (Yes, a GtkGrid has a
keybinding - 2 in fact), we need that controller everywhere.
2020-03-18 23:00:49 -04:00
Benjamin Otte
06660874ee
bindings: Make gtk_binding_parse_signal() use GVariantBuilder
...
And because it's the last user of GtkBindingArg and
gtk_binding_entry_add_signall(), also remove those two.
2020-03-18 23:00:49 -04:00
Benjamin Otte
4675d74e42
bindings: Parse into GVariantBuilder directly
...
Avoids the indirection via GtkBindingArg
2020-03-18 23:00:49 -04:00
Benjamin Otte
3b3a5c2d53
bindings: Add gtk_binding_entry_add_signal_variant()
...
This function is the replacement for
gtk_binding_entry_add_signall().
The GVariant will be demarshalled and passed to the action signal upon
binding activation. The same rules apply as used to apply for
GtkBindingArg, in that long, double and string args are now replaced by
"x", "d" and "s" variant types.
2020-03-18 23:00:49 -04:00
Benjamin Otte
385c5e0569
bindings: Replace GtkBindingArg arguments with GVariant
...
This only replaces invocation, not yet parsing.
2020-03-18 23:00:49 -04:00
Christian Hergert
6c8d47f585
textbtree: short-circuit visibility check when possible
...
If we have never seen a GtkTextTag in the GtkTextTagTable with the
invisible bit set, then we do not need to go through the process of
checking the accumulated tags.
Not using invisible tags is overwhelmingly the common case.
2020-03-18 11:32:46 -07:00
Matthias Clasen
1bc1b82256
Merge branch 'wip/jimmac/adwaitadark-lighten-switches' into 'master'
...
Adwaita: dark switches/check/radios
Closes #2461
See merge request GNOME/gtk!1532
2020-03-18 12:28:15 +00:00
Matthias Clasen
89c0df6cb7
Merge branch 'wip/chergert/textview-fix-gdk_event_unref' into 'master'
...
textview: use gdk_event_unref()
Closes #2520
See merge request GNOME/gtk!1531
2020-03-18 12:27:08 +00:00
Jakub Steiner
c91dd2cb45
Adwaita: dark switches/check/radios
...
- lighten up radios, switches and checkboxes
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2461
2020-03-18 13:01:17 +01:00
Matthias Clasen
3408ff1dd7
emojichooser: Fix keynav
...
Make arrow and tab keys work in the
variations popover again.
2020-03-17 21:49:29 -04:00
Matthias Clasen
7a46157edf
window: Set min size properly
...
When we are mapping the window, we need to compute
a proper min size, otherwise the 1, 1 sticks and
makes all windows shrinkable to nothing.
2020-03-17 20:46:57 -04:00
Matthias Clasen
01568dc915
Revert "Adwaita: dark switches/check/radios"
...
This reverts commit 435992600f
.
This causes warnings from the CSS parser.
2020-03-17 20:32:23 -04:00
Matthias Clasen
6eb848f0e0
popover: Add keynav keybindings
...
The shortcut controllers are limited to same-native,
so we need to duplicate the Tab and arrow key bindings
for focus handling, as well as the Enter bindings for
activation.
2020-03-17 20:15:26 -04:00
Christian Hergert
e4578b15c3
textview: use gdk_event_unref()
...
Fixes #2520
2020-03-17 13:24:03 -07:00
Jakub Steiner
435992600f
Adwaita: dark switches/check/radios
...
- lighten up radios, switches and checkboxes
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2461
2020-03-17 11:03:28 +01:00
Matthias Clasen
5d4b46b2d8
Merge branch 'emoji-chooser-fixes' into 'master'
...
Emoji chooser fixes
See merge request GNOME/gtk!1530
2020-03-17 05:12:12 +00:00
Matthias Clasen
292cea7310
Adwaita: Fix focus in emoji chooser
2020-03-17 00:28:57 -04:00
Matthias Clasen
4d7f0f330b
emojichooser: Make the variation picker work again
...
We can't attach popovers to unsuspecting widget anymore.
2020-03-17 00:07:37 -04:00
Robert Mader
5343ec3345
imcontextwayland: Honour len argument in gtk_im_context_wayland_set_surrounding
...
Clients may pass not `NULL`-terminated strings as the function takes a
`len` argument. Use that argument.
2020-03-16 16:53:33 +01:00
Matthias Clasen
c9ec1c6af1
Drop focus-related properties
...
We don't use these, and they are only implemented on X11.
2020-03-14 19:28:00 -04:00
Matthias Clasen
6f156dad7f
window: Drop keep above/below
2020-03-14 15:16:56 -04:00
Matthias Clasen
fb7ef8f62c
window: Drop sticky
...
This is an X11-only concept that we don't have
on Wayland.
2020-03-14 14:34:39 -04:00
Matthias Clasen
dfda88038e
window: Drop gtk_window_set_attached_to
...
We are no longer attaching windows to widgets.
2020-03-14 02:00:10 -04:00
Matthias Clasen
66a0a8d53e
Merge branch 'wip/baedert/test-cflags' into 'master'
...
Pass (almost) all our cflags to tests, testsuite, examples, demos, ...
See merge request GNOME/gtk!1516
2020-03-13 18:40:46 +00:00
Matthias Clasen
c5076675aa
a11y: Drop the private from GtkPopoverAccessible
...
It is not used, and empty structs upset msvc.
2020-03-13 09:51:04 -04:00
Matthias Clasen
9d98707f66
Merge branch 'present-toplevel-2' into 'master'
...
surface api splitup
See merge request GNOME/gtk!1511
2020-03-13 13:34:57 +00:00
Bastien Nocera
179b39eb86
Merge branch 'wip/hadess/fix-remote-filechooser-main' into 'master'
...
Fix crasher/warnings when browsing remote filesystems
Closes #2482
See merge request GNOME/gtk!1490
2020-03-13 12:36:10 +00:00
Matthias Clasen
19e2ab76ce
win32: Build fixes
...
These fixes were done blindly, to make the ci pass,
and will need review by somebody with access to an
actual win32 system to make sure the surface subtypes
are implemented properly.
2020-03-13 07:47:48 -04:00
Matthew Leeds
1963ff2951
gtk: Tweak GTK_ALIGN_BASELINE docs
2020-03-12 12:36:09 -07:00
Matthias Clasen
81be6ff46b
Move edge-constraints to GdkToplevel
2020-03-12 15:30:11 -04:00
Matthias Clasen
412a593618
widget: Stop using gdk_surface_set_opacity
2020-03-12 14:56:21 -04:00
Matthias Clasen
ceefe34027
gtkdragicon: Use drag surface api
2020-03-12 14:56:21 -04:00
Matthias Clasen
f90c0ccaf0
a11y: Stop using gdk_surface_get_state
2020-03-12 14:56:20 -04:00
Matthias Clasen
6edff8cd67
gtk: use toplevel state getter
2020-03-12 14:56:20 -04:00
Matthias Clasen
9266881691
window: Use GdkToplevel
2020-03-12 14:56:20 -04:00
Timm Bäder
822d67295a
Replace a few more fallthrough comments
2020-03-12 08:32:03 +01:00
Matthias Clasen
11c91065cf
window: Drop type hints
2020-03-11 19:36:04 -04:00