diff --git a/src/common/mixins/ComputeActionsMixin.js b/src/common/mixins/ComputeActionsMixin.js new file mode 100644 index 0000000..11689ee --- /dev/null +++ b/src/common/mixins/ComputeActionsMixin.js @@ -0,0 +1,28 @@ +export default { + computed: { + scopeActions: function() { + return this.settings.active.actions.filter(x => x.scopes[this.scope] && x.scopes[this.scope].show) || []; + }, + extensionActions: function(){ + return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-extension-mode') || []; + }, + aardActions: function(){ + return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-autoar-mode') || []; + }, + aspectRatioActions: function(){ + return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-ar') || []; + }, + stretchActions: function(){ + return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-stretch') || []; + }, + keyboardActions: function() { + return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-keyboard') || []; + }, + alignmentActions: function() { + return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-alignment') || []; + }, + otherActions: function() { + return this.scopeActions.filter(x => x.cmd.length > 1) || []; + } + } +} \ No newline at end of file diff --git a/src/popup/panels/DefaultSettingsPanel.vue b/src/popup/panels/DefaultSettingsPanel.vue index 9c13602..598759a 100644 --- a/src/popup/panels/DefaultSettingsPanel.vue +++ b/src/popup/panels/DefaultSettingsPanel.vue @@ -1,108 +1,110 @@