| import { MenuItemBase, newMenu } from './base.js'; |
| import { invoke } from '../core.js'; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| class CheckMenuItem extends MenuItemBase { |
| |
| constructor(rid, id) { |
| super(rid, id, 'Check'); |
| } |
| |
| static async new(opts) { |
| return newMenu('Check', opts).then(([rid, id]) => new CheckMenuItem(rid, id)); |
| } |
| |
| async text() { |
| return invoke('plugin:menu|text', { rid: this.rid, kind: this.kind }); |
| } |
| |
| async setText(text) { |
| return invoke('plugin:menu|set_text', { |
| rid: this.rid, |
| kind: this.kind, |
| text |
| }); |
| } |
| |
| async isEnabled() { |
| return invoke('plugin:menu|is_enabled', { rid: this.rid, kind: this.kind }); |
| } |
| |
| async setEnabled(enabled) { |
| return invoke('plugin:menu|set_enabled', { |
| rid: this.rid, |
| kind: this.kind, |
| enabled |
| }); |
| } |
| |
| async setAccelerator(accelerator) { |
| return invoke('plugin:menu|set_accelerator', { |
| rid: this.rid, |
| kind: this.kind, |
| accelerator |
| }); |
| } |
| |
| async isChecked() { |
| return invoke('plugin:menu|is_checked', { rid: this.rid }); |
| } |
| |
| async setChecked(checked) { |
| return invoke('plugin:menu|set_checked', { |
| rid: this.rid, |
| checked |
| }); |
| } |
| } |
|
|
| export { CheckMenuItem }; |
|
|