| 'use strict'; |
|
|
| var base = require('./base.cjs'); |
| var core = require('../core.cjs'); |
| var image = require('../image.cjs'); |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| exports.NativeIcon = void 0; |
| (function (NativeIcon) { |
| |
| NativeIcon["Add"] = "Add"; |
| |
| NativeIcon["Advanced"] = "Advanced"; |
| |
| NativeIcon["Bluetooth"] = "Bluetooth"; |
| |
| NativeIcon["Bookmarks"] = "Bookmarks"; |
| |
| NativeIcon["Caution"] = "Caution"; |
| |
| NativeIcon["ColorPanel"] = "ColorPanel"; |
| |
| NativeIcon["ColumnView"] = "ColumnView"; |
| |
| NativeIcon["Computer"] = "Computer"; |
| |
| NativeIcon["EnterFullScreen"] = "EnterFullScreen"; |
| |
| NativeIcon["Everyone"] = "Everyone"; |
| |
| NativeIcon["ExitFullScreen"] = "ExitFullScreen"; |
| |
| NativeIcon["FlowView"] = "FlowView"; |
| |
| NativeIcon["Folder"] = "Folder"; |
| |
| NativeIcon["FolderBurnable"] = "FolderBurnable"; |
| |
| NativeIcon["FolderSmart"] = "FolderSmart"; |
| |
| NativeIcon["FollowLinkFreestanding"] = "FollowLinkFreestanding"; |
| |
| NativeIcon["FontPanel"] = "FontPanel"; |
| |
| NativeIcon["GoLeft"] = "GoLeft"; |
| |
| NativeIcon["GoRight"] = "GoRight"; |
| |
| NativeIcon["Home"] = "Home"; |
| |
| NativeIcon["IChatTheater"] = "IChatTheater"; |
| |
| NativeIcon["IconView"] = "IconView"; |
| |
| NativeIcon["Info"] = "Info"; |
| |
| NativeIcon["InvalidDataFreestanding"] = "InvalidDataFreestanding"; |
| |
| NativeIcon["LeftFacingTriangle"] = "LeftFacingTriangle"; |
| |
| NativeIcon["ListView"] = "ListView"; |
| |
| NativeIcon["LockLocked"] = "LockLocked"; |
| |
| NativeIcon["LockUnlocked"] = "LockUnlocked"; |
| |
| NativeIcon["MenuMixedState"] = "MenuMixedState"; |
| |
| NativeIcon["MenuOnState"] = "MenuOnState"; |
| |
| NativeIcon["MobileMe"] = "MobileMe"; |
| |
| NativeIcon["MultipleDocuments"] = "MultipleDocuments"; |
| |
| NativeIcon["Network"] = "Network"; |
| |
| NativeIcon["Path"] = "Path"; |
| |
| NativeIcon["PreferencesGeneral"] = "PreferencesGeneral"; |
| |
| NativeIcon["QuickLook"] = "QuickLook"; |
| |
| NativeIcon["RefreshFreestanding"] = "RefreshFreestanding"; |
| |
| NativeIcon["Refresh"] = "Refresh"; |
| |
| NativeIcon["Remove"] = "Remove"; |
| |
| NativeIcon["RevealFreestanding"] = "RevealFreestanding"; |
| |
| NativeIcon["RightFacingTriangle"] = "RightFacingTriangle"; |
| |
| NativeIcon["Share"] = "Share"; |
| |
| NativeIcon["Slideshow"] = "Slideshow"; |
| |
| NativeIcon["SmartBadge"] = "SmartBadge"; |
| |
| NativeIcon["StatusAvailable"] = "StatusAvailable"; |
| |
| NativeIcon["StatusNone"] = "StatusNone"; |
| |
| NativeIcon["StatusPartiallyAvailable"] = "StatusPartiallyAvailable"; |
| |
| NativeIcon["StatusUnavailable"] = "StatusUnavailable"; |
| |
| NativeIcon["StopProgressFreestanding"] = "StopProgressFreestanding"; |
| |
| NativeIcon["StopProgress"] = "StopProgress"; |
| |
| NativeIcon["TrashEmpty"] = "TrashEmpty"; |
| |
| NativeIcon["TrashFull"] = "TrashFull"; |
| |
| NativeIcon["User"] = "User"; |
| |
| NativeIcon["UserAccounts"] = "UserAccounts"; |
| |
| NativeIcon["UserGroup"] = "UserGroup"; |
| |
| NativeIcon["UserGuest"] = "UserGuest"; |
| })(exports.NativeIcon || (exports.NativeIcon = {})); |
| |
| |
| |
| |
| class IconMenuItem extends base.MenuItemBase { |
| |
| constructor(rid, id) { |
| super(rid, id, 'Icon'); |
| } |
| |
| static async new(opts) { |
| return base.newMenu('Icon', opts).then(([rid, id]) => new IconMenuItem(rid, id)); |
| } |
| |
| async text() { |
| return core.invoke('plugin:menu|text', { rid: this.rid, kind: this.kind }); |
| } |
| |
| async setText(text) { |
| return core.invoke('plugin:menu|set_text', { |
| rid: this.rid, |
| kind: this.kind, |
| text |
| }); |
| } |
| |
| async isEnabled() { |
| return core.invoke('plugin:menu|is_enabled', { rid: this.rid, kind: this.kind }); |
| } |
| |
| async setEnabled(enabled) { |
| return core.invoke('plugin:menu|set_enabled', { |
| rid: this.rid, |
| kind: this.kind, |
| enabled |
| }); |
| } |
| |
| async setAccelerator(accelerator) { |
| return core.invoke('plugin:menu|set_accelerator', { |
| rid: this.rid, |
| kind: this.kind, |
| accelerator |
| }); |
| } |
| |
| async setIcon(icon) { |
| return core.invoke('plugin:menu|set_icon', { |
| rid: this.rid, |
| kind: this.kind, |
| icon: image.transformImage(icon) |
| }); |
| } |
| } |
|
|
| exports.IconMenuItem = IconMenuItem; |
|
|