Skip to main content

类:TouchBarPopover

类:TouchBarPopover

¥Class: TouchBarPopover

在触摸栏中为原生 macOS 应用创建弹出窗口

¥Create a popover in the touch bar for native macOS applications

进程:主进程
该类不是从 'electron' 模块导出的。它仅可用作 Electron API 中其他方法的返回值。

¥Process: Main
This class is not exported from the 'electron' module. It is only available as a return value of other methods in the Electron API.

new TouchBarPopover(options)

  • options 对象

    ¥options Object

    • label 字符串(可选) - 弹出按钮文本。

      ¥label string (optional) - Popover button text.

    • icon NativeImage(可选) - 弹出按钮图标。

      ¥icon NativeImage (optional) - Popover button icon.

    • items TouchBar - 要在弹出窗口中显示的项目。

      ¥items TouchBar - Items to display in the popover.

    • showCloseButton 布尔值(可选) - true 在弹出窗口左侧显示关闭按钮,false 不显示它。默认为 true

      ¥showCloseButton boolean (optional) - true to display a close button on the left of the popover, false to not show it. Default is 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.