类: TouchBarPopover

优质
小牛编辑
133浏览
2023-12-01

类: TouchBarPopover

为macOS原生应用在触摸栏中创建一个弹出控件

Process: Main 此类不从 'electron' 模块导出. 它只能作为Electron API中其他方法的返回值。

new TouchBarPopover(options)

  • 选项 对象
    • labelString (可选) 弹出按钮文本。
    • icon (NativeImage | String) (可选) - 弹出按钮图标。
    • items TouchBar - Items to display in the popover.
    • showCloseButton Boolean (optional) - true to display a close button on the left of the popover, false to not show it. 默认值为 true

实例属性

以下为 TouchBarPopover 实例的可用属性:

touchBarPopover.label

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

touchBarPopover.icon

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