Commit Graph

9 Commits

Author SHA1 Message Date
Timm Bäder
0e73bfa202 shortcutmanager: Speed up default_remove_controller a bit
Only call get_n_items on the model once and remove two unnecessary
casts.
2020-05-05 08:20:10 +02:00
Matthias Clasen
1ec2d1d9f1 shortcutmanager: Add some more docs 2020-03-25 23:14:45 -04:00
Matthias Clasen
c2e2e2993b shortcutmanager: Use list models 2020-03-25 23:14:28 -04:00
Emmanuele Bassi
aab10ea43b Add GtkShortcutManager
This adds an interface for taking care of shortcut controllers with
managed scope.

Only GtkWindow currently implements this interface, so we need to ensure
that we check if any top-level widget we reach is a shortcuts manager
before we call into it.
2020-03-25 23:14:27 -04:00
Matthias Clasen
31db615885 Revert "Merge branch 'disable-window-test' into 'master'"
This reverts commit 3ac4c76b18, reversing
changes made to 6ec96d2e98.
2020-03-19 18:03:16 -04:00
Matthias Clasen
5a6a9dc149 shortcutmanager: Name the controllers
This is helpful in the inspector.
2020-03-18 23:00:51 -04:00
Matthias Clasen
ad69899a9d Move shortcut manager initialization code
It is just too ugly to use quarks across multiple
source files, so add a private helper function that
attaches the controllers.
2020-03-18 23:00:51 -04:00
Benjamin Otte
0c81698911 shortcuts: Mananage managed shortcuts with a custom model
Reduce the amount of special casing by using a list model
for global and managed shortcuts, too.

This way, the ListModel API will work for the ShortcutController in the
GtkShortcutManager and GtkRoot.

The only special case remaining is shortcut activation, which needs to
pass the right widget to the controller in the global/managed case.
2020-03-18 23:00:51 -04:00
Emmanuele Bassi
09400b6bfe Add GtkShortcutManager
This adds an interface for taking care of shortcut controllers with
managed scope.

Only GtkWindow currently implements this interface, so we need to ensure
that we check if any top-level widget we reach is a shortcuts manager
before we call into it.
2020-03-18 23:00:50 -04:00