Skip to main content

Class: TouchBarSpacer

Class: TouchBarSpacer

Create a spacer between two items in the touch bar for native macOS applications为本机macOS应用程序在触摸条中的两个项目之间创建一个间隔符

Process:进程:Main
This class is not exported from the 'electron' module. 此类不是从'electron'模块导出的。It is only available as a return value of other methods in the Electron API.它只能作为Electron API中其他方法的返回值使用。

new TouchBarSpacer(options)

  • options Object
    • size string (optional) - Size of spacer, possible values are:垫片尺寸,可能值为:
      • small - Small space between items. 物品之间的空间很小。Maps to NSTouchBarItemIdentifierFixedSpaceSmall. 映射到NSTouchBarItemIdentifierFixedSpaceSmallThis is the default.这是默认设置。
      • large - Large space between items. 物品之间的空间很大。Maps to NSTouchBarItemIdentifierFixedSpaceLarge.映射到NSTouchBarItemIdentifierFixedSpaceLarge
      • flexible - Take up all available space. 占用所有可用空间。Maps to NSTouchBarItemIdentifierFlexibleSpace.映射到NSTouchBarItemIdentifierFlexibleSpace

Instance Properties实例属性

The following properties are available on instances of TouchBarSpacer:TouchBarSpacer实例上提供了以下属性:

touchBarSpacer.size

A string representing the size of the spacer. 表示垫片尺寸的stringCan be small, large or flexible.可以是smalllargeflexible