Benjamin Otte
6e164b6c82
label: Implement mnemonics using shortcuts
2019-05-15 17:20:46 -03:00
Benjamin Otte
171505b823
shortcut: Add gtk_shortcut_set_mnemonic_activate()
...
Makes the shortcut call gtk_widget_mnemonic_activate() upon activation.
2019-05-15 17:20:46 -03:00
Benjamin Otte
85c5585c63
shortcuttrigger: Add support for mnemonics
...
Mnemonics need to be triggered with help from the controllers (who
determine the modifiers). Support for that has been added, too.
Mnemonics do not use this yet though.
2019-05-15 17:20:45 -03:00
Benjamin Otte
2f29b14bec
window: Put F10 accelerator into its own shortcut controller
...
So instead of relying on gtk_window_activate_key(), it's now using
proper infrastructure.
2019-05-15 17:20:45 -03:00
Benjamin Otte
1db44a0af2
window: Get rid of public APIs that shouldn't be
...
Event controllers should have replaced all of them. And if they haven't,
apps need to fix their code (I'm looking at you Gimp).
2019-05-15 17:20:45 -03:00
Benjamin Otte
1d106ea36b
gdk: Remove GDK_RELEASE_MASK
...
It was only ever supported by keybindings and those are gone now.
2019-05-15 17:20:45 -03:00
Benjamin Otte
35222a40f8
gtk-demo: Add a dumb demo for shortcut triggers
2019-05-15 17:20:45 -03:00
Benjamin Otte
6ceaa17597
shortcutcontroller: Add GtkShortcutScope
...
Allow setting the scope for a controller. The scope determines at what
point in event propagation the shortcuts will be activated.
Local scope is the usual activation, global scope means that the root
widget activates the shortcuts - ie they are activated at the very
start of event propagation (for global capture events) or the very end
(for global bubble events).
Managed scope so far is unimplemented.
This is supposed to be used to replace accelerators and mnemonics.
2019-05-15 17:20:44 -03:00
Benjamin Otte
a554a5cb93
shortcuttrigger: Add gtk_shortcut_trigger_to_label()
...
Provide a user-presentable string.
2019-05-15 17:20:44 -03:00
Benjamin Otte
852953121d
accelgroup: Add gtk_accel_group_print_label()
2019-05-15 17:20:44 -03:00
Benjamin Otte
291d7f9897
accellabel: Move gtk_accelerator_get_label() code
...
The function lives in gtkaccelgroup.c, so there's no need to have that
call a private function in another source file. Instead, make that
other source file call gtk_accelerator_get_label() instead.
2019-05-15 17:20:44 -03:00
Benjamin Otte
d73be336d0
accellabel: Get rid of class variables
...
We can just look them up as-needed, no need to cache them.
2019-05-15 17:20:44 -03:00
Benjamin Otte
09af271445
gtk: Remove bindings
...
The whole binding functionality is now handled by shortcuts.
2019-05-15 17:20:43 -03:00
Georges Basile Stavracas Neto
811a2ea698
eventcontrollerkey: Remove binding handling
2019-05-15 17:20:43 -03:00
Georges Basile Stavracas Neto
e0723d74e6
passwordentry: Remove unused header
2019-05-15 17:20:43 -03:00
Benjamin Otte
e3ead985e4
accelgroup: Actually have a default mod mask
...
Don't just use a value without initializing it.
2019-05-15 17:20:43 -03:00
Benjamin Otte
cf4c4e0465
treeview: Redo event forwarding hack
...
Reorder the event controllers so that key forwarding to the search
entries really happens after shortcut triggering.
2019-05-15 17:20:43 -03:00
Benjamin Otte
ee815e0cf5
combobox: Redo key event forwarding hack
...
Instead of manualling invoking bindings, we now reorder event
controllers inside the treemenu, so that shortcuts run before the event
forwarding.
2019-05-15 17:20:42 -03:00
Benjamin Otte
16fd077867
iconview: Port bindings to use shortcuts
2019-05-15 17:20:42 -03:00
Benjamin Otte
2c25375663
infobar: Port bindings to use shortcuts
2019-05-15 17:20:42 -03:00
Benjamin Otte
c340a18b0f
label: Port bindings to use shortcuts
2019-05-15 17:20:41 -03:00
Benjamin Otte
f164fe371c
listbox: Port bindings to use shortcuts
2019-05-15 17:20:41 -03:00
Benjamin Otte
533200a016
menubar: Port bindings to use shortcuts
2019-05-15 17:20:41 -03:00
Benjamin Otte
614a1c694d
menu: Port bindings to use shortcuts
2019-05-15 17:20:41 -03:00
Benjamin Otte
d5d032cb08
menushell: Port bindings to use shortcuts
2019-05-15 17:20:41 -03:00
Benjamin Otte
f19f7f793c
notebook: Port bindings to use shortcuts
2019-05-15 17:20:40 -03:00
Benjamin Otte
c891f2e562
scale: Port bindings to use shortcuts
2019-05-15 17:20:40 -03:00
Benjamin Otte
fed84e47a6
scalebutton: Port bindings to use shortcuts
2019-05-15 17:20:40 -03:00
Benjamin Otte
fb4126f1fd
scrolledwindow: Port bindings to use shortcuts
2019-05-15 17:20:40 -03:00
Benjamin Otte
78717fb175
searchentry: Port bindings to use shortcuts
2019-05-15 17:20:40 -03:00
Benjamin Otte
9474c1dd9f
shortcutssection: Port bindings to use shortcuts
2019-05-15 17:20:39 -03:00
Benjamin Otte
0ccb4036c2
shortcutswindow: Port bindings to use shortcuts
2019-05-15 17:20:39 -03:00
Benjamin Otte
9dacd803a1
flowbox: Port bindings to use shortcuts
2019-05-15 17:20:39 -03:00
Benjamin Otte
82434c44fb
paned: Port bindings to use shortcuts
2019-05-15 17:20:39 -03:00
Benjamin Otte
114b8be8a3
spinbutton: Port bindings to use shortcuts
2019-05-15 17:20:39 -03:00
Benjamin Otte
b204748dbc
textview: Port bindings to use shortcuts
2019-05-15 17:20:39 -03:00
Benjamin Otte
03fdc3eea0
filechooserwidget: Port bindings to use shortcuts
2019-05-15 17:20:38 -03:00
Benjamin Otte
14fba445f4
toolbar: Port bindings to use shortcuts
2019-05-15 17:20:38 -03:00
Benjamin Otte
05662e194b
shortcutcontroller: Add gtk_shortcut_controller_add_shortcut()
...
... and gtk_shortcut_controller_remove_shortcut().
2019-05-15 17:20:38 -03:00
Benjamin Otte
fbb58721b6
shortcutcontroller: Add private API for running class shortcuts
...
We don't want regular users to be able to run class shortcuts in their
controllers, so we have to special case that.
2019-05-15 17:20:38 -03:00
Benjamin Otte
9bdb03ae56
treeview: Port bindings to use shortcuts
2019-05-15 17:20:38 -03:00
Benjamin Otte
90d699b483
widget: Port bindings to use shortcuts
2019-05-15 17:20:37 -03:00
Benjamin Otte
b7b3cb1f13
dialog: Port binding to use shortcuts
2019-05-15 17:20:37 -03:00
Benjamin Otte
2ea5835e5b
text: Port bindings to use shortcuts
2019-05-15 17:20:37 -03:00
Benjamin Otte
822f28989f
shortcut: Add gtk_shortcut_set_callback()
...
... and gtk_widget_class_add_binding() to go with it.
This allows shortcuts to invoke manually added callbacks.
2019-05-15 17:20:37 -03:00
Benjamin Otte
791176611f
combobox: Port bindings to use shortcuts
2019-05-15 17:20:37 -03:00
Benjamin Otte
e1fe9c8973
assistant: Port bindings to use shortcuts
2019-05-15 17:20:36 -03:00
Benjamin Otte
8542481ba1
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.
2019-05-15 17:20:36 -03:00
Benjamin Otte
eec8a96d0c
shortcut: Add GtkShortcutTrigger
...
Triggers are meant to describe how to trigger a shortcut. So far only a
keyval + modifiers trigger exists.
2019-05-15 17:20:36 -03:00
Benjamin Otte
6edcf01ff6
contentformats: Fix doc typo
2019-05-15 17:20:36 -03:00