Small cleanup

This commit is contained in:
Rafał Dzięgiel
2021-04-21 16:59:06 +02:00
parent 7559a61c9f
commit bfbbc517d5
3 changed files with 6 additions and 9 deletions

View File

@@ -35,17 +35,15 @@ 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 action in Menu.actions) { for(let name in Menu.actions) {
const simpleAction = new Gio.SimpleAction({ const simpleAction = new Gio.SimpleAction({ name });
name: action
});
simpleAction.connect( simpleAction.connect(
'activate', () => Menu.actions[action].run(this.active_window) 'activate', () => Menu.actions[name].run(this.active_window)
); );
this.add_action(simpleAction); this.add_action(simpleAction);
if(Menu.actions[action].accels) if(Menu.actions[name].accels)
this.set_accels_for_action(`app.${action}`, Menu.actions[action].accels); this.set_accels_for_action(`app.${name}`, Menu.actions[name].accels);
} }
} }

View File

@@ -1,4 +1,3 @@
const { GObject, Gtk } = imports.gi;
const Dialogs = imports.src.dialogs; const Dialogs = imports.src.dialogs;
var actions = { var actions = {

View File

@@ -1,4 +1,4 @@
const { Gdk, Gio, GLib, GObject, Gst, GstClapper, Gtk } = imports.gi; const { Gdk, Gio, GObject, Gst, GstClapper, Gtk } = imports.gi;
const ByteArray = imports.byteArray; const ByteArray = imports.byteArray;
const Debug = imports.src.debug; const Debug = imports.src.debug;
const Misc = imports.src.misc; const Misc = imports.src.misc;