Commit Graph

58755 Commits

Author SHA1 Message Date
Matthias Clasen
3fcfcf51f6 treeview: Avoid popup-menu 2019-06-24 22:44:31 +00:00
Matthias Clasen
aa04678239 scrollbar: Avoid popup-menu 2019-06-24 22:44:31 +00:00
Matthias Clasen
0dccb3de40 placesview: Avoid the use of popup-menu 2019-06-24 22:44:31 +00:00
Matthias Clasen
f9c670b7c6 mountoperation: Avoid use of popup-menu 2019-06-24 22:40:29 +00:00
Matthias Clasen
e40758ec26 file chooser: Avoid use of popup-menu 2019-06-24 22:40:29 +00:00
Matthias Clasen
ce19f5a282 color editor: Avoid popup-menu use 2019-06-24 22:40:29 +00:00
Matthias Clasen
b050572918 popover: Switch activate-default to an action
This matches what we already did for GtkWindow.
2019-06-24 22:40:29 +00:00
Matthias Clasen
f6f8f4b742 shortcutaction: Just use gtk_widget_activate_action
We can just rely on this, no need to do manual
action group juggling here.
2019-06-24 22:40:29 +00:00
Matthias Clasen
318ac2f823 shortcut action: Fix a wrong cast 2019-06-24 22:40:29 +00:00
Matthias Clasen
af689a2a5c tests: Skip GtkShortcutsController::model
The defaultvalue test can't handle object-valued
properties with non-NULL initial value.
2019-06-24 22:40:29 +00:00
Matthias Clasen
caf73e7211 text: Documentation for actions
Add doc comments to all GtkText actions.

gtk-doc will need to learn to extract action
documentation. This is using a CLASS|action
format to differentiate actions from properties
and signals. For actions with parameters, we
use the normal gtk-doc syntax for arguments.
2019-06-24 22:40:29 +00:00
Matthias Clasen
fca13bd00c introspection test: Update
GtkText has some new actions.
2019-06-24 22:40:29 +00:00
Matthias Clasen
6d4fcd9633 widget: Quiet a compiler warning 2019-06-24 22:40:29 +00:00
Matthias Clasen
dfd20e037b shortcut trigger: Silence gtk-doc warnings 2019-06-24 22:40:29 +00:00
Matthias Clasen
d9b771aa7f shortcut controller: Silence gtk-doc warnings 2019-06-24 22:40:29 +00:00
Matthias Clasen
7873f5c4eb shortcut action: Silence gtk-doc warnings 2019-06-24 22:40:29 +00:00
Matthias Clasen
60479bedae password entry: Silence gtk-doc warnings 2019-06-24 22:40:29 +00:00
Matthias Clasen
6b632ca139 entry: Silence gtk-doc warnings 2019-06-24 22:40:29 +00:00
Matthias Clasen
a92ab66024 docs: Make the shooter build again 2019-06-24 22:40:29 +00:00
Matthias Clasen
8ab76574cd Redo default activation in entries
Remove the activates-default property in GtkText
and move this functionality to the entry wrapper
classes instead. Add an activate action and
bindings where necessary.

With this, GtkText is completely converted from
keybinding signals to actions.
2019-06-24 22:40:29 +00:00
Matthias Clasen
21e9fc054e text: Drop keybinding signals
These are not used anymore.
2019-06-24 22:40:29 +00:00
Matthias Clasen
1cbb2099a2 text: Stop using keybinding signals internally
We can just call the class handlers.
2019-06-24 22:40:29 +00:00
Matthias Clasen
7ed27ef574 text: Convert bindings to actions 2019-06-24 22:40:29 +00:00
Matthias Clasen
9039d0b0c1 text: Add more actions
These will let us port more bindings to actions.
2019-06-24 22:40:29 +00:00
Matthias Clasen
00e68fcae2 widget: Unset propagation limits for shortcut managers
These controllers are meant to be global and
thus should be able to react to events that are
getting routed to open popovers. This makes
shortcuts in open popover menus work.
2019-06-24 22:40:29 +00:00
Matthias Clasen
9038b7a8c5 widget_factory: Stop using GtkApplication for accels
We want to replace the accels APIs in GtkApplication
with shortcut controllers.
2019-06-24 22:40:29 +00:00
Matthias Clasen
0a7f5f1be1 text: Convert bindings from signals to actions
With this change, the context menu picks up the
accels for the actions. The conversion is not
complete, since we don't have actions for all
bindings yet.
2019-06-24 22:40:29 +00:00
Matthias Clasen
70597de0a5 widget: Pass shortcuts to the action muxer
Send the shortcuts used by shortcut managers
and the per-class shortcuts to the action muxer
for associating accels with actions. The
action muxer has existing machinery for propagating
accels to the UI.
2019-06-24 22:40:29 +00:00
Matthias Clasen
75b19169cf action muxer: Support injecting shortcuts
Give the action muxer an api to add list models
of shortcuts to draw accels from.
2019-06-24 22:40:29 +00:00
Matthias Clasen
390ba974df model button: Drop accel lookup hack
We were just cutting through to the application
at map time in a last-ditch effort to find
an accel to display. Drop that and just rely on
the menu tracker to give us the right thing.
2019-06-24 22:40:29 +00:00
Matthias Clasen
d9167fc8d6 model button: Stop parsing accels
The new shortcuts machinery gives us formatted
strings, so just use them as-is without parsing
and reformatting.
2019-06-24 22:40:29 +00:00
Matthias Clasen
d000bed15f popover menu: Make mnemonics visible
For menus, mnemonics trigger without pressing Alt,
and the expectation is that we show them whenever
keynav is happening. Reinstate this behavior for
popover menus.
2019-06-24 22:40:29 +00:00
Matthias Clasen
b1ac7b667c popover menu: Implement shortcut manager
And make mnemonics trigger without Alt,
like we already do for GtkMenu.
2019-06-24 22:40:29 +00:00
Matthias Clasen
b89dee2f56 shortcut controller: Factor out a helper
No need to have the same code in multiple places.
2019-06-24 22:40:29 +00:00
Matthias Clasen
0f75f33857 Implement group cycling
When more than one shortcut can trigger,
activate them non-exclusively, round-robin.
2019-06-24 22:40:29 +00:00
Matthias Clasen
f41931f527 label: Remove mnemonics when unmapped
We never want mnemonics to trigger when the user
can't see them, so remove them from the shortcuts
manager.
2019-06-24 22:40:29 +00:00
Matthias Clasen
fa8ffa6d6c Set names on shortcut controllers 2019-06-24 22:40:29 +00:00
Matthias Clasen
b2be6db1ed inspector: Show owners for shortcuts
This is somewhat preliminary, but it helps
debugging shortcuts. It suffers from not having
the right list model apis to do this.

Eventually, this should become a link to the
object details.
2019-06-24 22:40:29 +00:00
Matthias Clasen
949afa598a inspector: Add a quick shortcuts page
This shows the shortcuts for a GtkShortcutController
object.
2019-06-24 22:40:29 +00:00
Matthias Clasen
56bc921586 inspector: Show shortcut actions and triggers
Show these in the property details for
GtkShortcut objects.
2019-06-24 22:40:29 +00:00
Matthias Clasen
d0509d5afc shortcut controller: Make model readable
We want to show the shortcuts in the inspector,
so we need to be able to get at the model.
2019-06-24 22:40:29 +00:00
Matthias Clasen
a9c0548179 window: Use gtk_widget_class_bind_action
Use gtk_widget_class_bind_action for default.activate.
2019-06-24 22:40:29 +00:00
Matthias Clasen
79c5398690 Add gtk_widget_class_bind_action
Similar to gtk_widget_class_add_binding_signal,
but triggers an action.
2019-06-24 22:40:29 +00:00
Georges Basile Stavracas Neto
26d310fb07 shortcutcontroller: Unref shortcut proper
g_list_model_get_item() is transfer full, so we need to
unref everything that is acquired through it.
2019-06-24 22:40:29 +00:00
Georges Basile Stavracas Neto
1787bf5471 shortcuttrigger: Filter a few modifiers out
Copying the code from GtkKeyHash, filter out X11 modifiers and
Caps Lock from events. Unfortunately, legacy X11 modifiers can
be present even when running full Wayland, due to XKB.
2019-06-24 22:40:29 +00:00
Benjamin Otte
2ace9aef5f filechooser: Trigger the location popup via bindings
Simplifies code quite a bit.
2019-06-24 22:40:29 +00:00
Benjamin Otte
b46e7f1108 filechooser: Remove outdated hack
In GTK2, the filechooser was using a Paned, so switching between sidebar
and files list with the arrow keys didn't work (the slider would be
selected instead). So in
https://bugzilla.gnome.org/show_bug.cgi?id=161489 a crude hack was added
to make this possible.

Over the years the filechooser code has changed so that it now would do
this by default, yet the hack had been retained.
2019-06-24 22:40:29 +00:00
Benjamin Otte
cedb413600 accels: Remove GtkAccelGroup 2019-06-24 22:40:29 +00:00
Benjamin Otte
f0b41b181d testmenubutton: Don't create a GtkAccelGroup
It's unused.
2019-06-24 22:40:29 +00:00
Benjamin Otte
9c46eb4398 testsuite: Remove GtkAccelGroup usage 2019-06-24 22:40:29 +00:00