Skip to main content

类:TouchBarPopover

类:TouchBarPopover

🌐 Class: TouchBarPopover

为本地 macOS 应用在触控栏中创建弹出窗口

进程: 主进程
此类未从 'electron' 模块导出。它仅作为 Electron API 中其他方法的返回值提供。

new TouchBarPopover(options)

  • options 对象
    • label 字符串(可选)- 弹出按钮文本。
    • icon 本地图片(可选)- 弹出按钮图标。
    • items TouchBar - 在弹出窗口中显示的项目。
    • showCloseButton 布尔值(可选)- true 表示在弹出框左侧显示关闭按钮,false 表示不显示。默认值是 true

实例属性

🌐 Instance Properties

TouchBarPopover 实例上可用的属性如下:

🌐 The following properties are available on instances of TouchBarPopover:

touchBarPopover.label

string 表示弹出窗口当前按钮的文本。更改此值会立即更新触控栏中的弹出窗口。

🌐 A string representing the popover's current button text. Changing this value immediately updates the popover in the touch bar.

touchBarPopover.icon

NativeImage 表示弹出窗口当前按钮的图标。更改此值会立即更新触控栏上的弹出窗口。

🌐 A NativeImage representing the popover's current button icon. Changing this value immediately updates the popover in the touch bar.