Skip to main content

类:TouchBarSpacer

类:TouchBarSpacer

¥Class: TouchBarSpacer

在原生 macOS 应用的触摸栏中的两个项目之间创建间隔

¥Create a spacer between two items 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 TouchBarSpacer(options)

  • options 对象

    ¥options Object

    • size 字符串(可选) - 垫片尺寸,可能的值为:

      ¥size string (optional) - Size of spacer, possible values are:

      • small - 物品之间的空间很小。映射到 NSTouchBarItemIdentifierFixedSpaceSmall。这是默认设置。

        ¥small - Small space between items. Maps to NSTouchBarItemIdentifierFixedSpaceSmall. This is the default.

      • large - 物品之间的空间较大。映射到 NSTouchBarItemIdentifierFixedSpaceLarge

        ¥large - Large space between items. Maps to NSTouchBarItemIdentifierFixedSpaceLarge.

      • flexible - 占用所有可用空间。映射到 NSTouchBarItemIdentifierFlexibleSpace

        ¥flexible - Take up all available space. Maps to NSTouchBarItemIdentifierFlexibleSpace.

实例属性

¥Instance Properties

以下属性在 TouchBarSpacer 的实例上可用:

¥The following properties are available on instances of TouchBarSpacer:

touchBarSpacer.size

string 代表垫片的尺寸。可以是 smalllargeflexible

¥A string representing the size of the spacer. Can be small, large or flexible.