Commit Graph

3 Commits

Author SHA1 Message Date
Benjamin Otte
83801768fa shortcut: Change the API for creating shortcuts
When creating shortcuts, there almost always are a trigger and an action
available for use. So make gtk_shortcut_new() take those as arguments.

Also add gtk_shortcut_new_with_arguments() so people can easily pass
those in, too.
2020-03-22 11:14:07 -04:00
Benjamin Otte
2f0e94ccad shortcut: Add GtkShortcutAction
Similar to GtkShortcutTrigger, GtkShortCutAction provides all the
different ways to activate a shortcut.

So far, these different ways are supported:

 - do nothing
 - Call a user-provided callback
 - Call gtk_widget_activate()
 - Call gtk_widget_mnemonic_activate()
 - Emit an action signal
 - Activate an action from the widget's action muxer
 - Activate a GAction
2020-03-22 11:14:07 -04:00
Benjamin Otte
e0602c41d8 gtk-demo: Add a dumb demo for shortcut triggers 2020-03-22 11:14:06 -04:00