mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Fix missing actions shortcuts in main menu
Actions were loaded too early, causing GTK to not recognize them and show their keyboard shortcuts next to main menu items
This commit is contained in:
@@ -34,18 +34,6 @@ class ClapperAppBase extends Gtk.Application
|
|||||||
|
|
||||||
if(!settings.get_boolean('render-shadows'))
|
if(!settings.get_boolean('render-shadows'))
|
||||||
window.add_css_class('gpufriendly');
|
window.add_css_class('gpufriendly');
|
||||||
|
|
||||||
for(let name in Actions.actions) {
|
|
||||||
const simpleAction = new Gio.SimpleAction({ name });
|
|
||||||
simpleAction.connect('activate', (action) =>
|
|
||||||
Actions.handleAction(action, this.active_window)
|
|
||||||
);
|
|
||||||
this.add_action(simpleAction);
|
|
||||||
|
|
||||||
const accels = Actions.actions[name];
|
|
||||||
if(accels)
|
|
||||||
this.set_accels_for_action(`app.${name}`, accels);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_activate()
|
vfunc_activate()
|
||||||
@@ -92,6 +80,18 @@ class ClapperAppBase extends Gtk.Application
|
|||||||
|
|
||||||
_onFirstActivate()
|
_onFirstActivate()
|
||||||
{
|
{
|
||||||
|
for(let name in Actions.actions) {
|
||||||
|
const simpleAction = new Gio.SimpleAction({ name });
|
||||||
|
simpleAction.connect('activate', (action) =>
|
||||||
|
Actions.handleAction(action, this.active_window)
|
||||||
|
);
|
||||||
|
this.add_action(simpleAction);
|
||||||
|
|
||||||
|
const accels = Actions.actions[name];
|
||||||
|
if(accels)
|
||||||
|
this.set_accels_for_action(`app.${name}`, accels);
|
||||||
|
}
|
||||||
|
|
||||||
const gtkSettings = Gtk.Settings.get_default();
|
const gtkSettings = Gtk.Settings.get_default();
|
||||||
settings.bind(
|
settings.bind(
|
||||||
'dark-theme', gtkSettings,
|
'dark-theme', gtkSettings,
|
||||||
|
Reference in New Issue
Block a user