类: TouchBarScrubber
类: TouchBarScrubber
创建一个scrubber (可滚动的选择程序)
Process: Main
This class is not exported from the 'electron' module. 它只能作为 Electron API 中其他方法的返回值。
new TouchBarScrubber(options)
选项对象itemsScrubberItem[] - An array of items to place in this scrubber.selectFunction (可选) - 当用户触按的项目不是上次触按的项目时调用。selectedIndexInteger - 用户选中项排序。
highlightFunction (可选) - 当用户触按任一项目时调用。- highlightedIndex Integer - 用户选中项排序.
selectedStylestring (可选) - 被选项目的样式。 可以是background,outline或none. 默认值为:none。overlayStylestring (可选) - 选择叠层项的样式。 可以是background,outline或none. 默认值为:none。showArrowButtonsboolean (可选) - 是否在任务栏中显示窗口。 默认为false并且只在items是非空的情况下才显示。modestring (可选) - 可以是fixed或free。 默认值为free.continuousboolean (可选) - 默认为true。
实例属性
以下为 TouchBarScrubber 实例的可用属性:
touchBarScrubber.items
一个Scrubberitem[] 数组代表Scrubber里的所有物品。 改变这个值会立刻刷新touch bar内的控件。 然而改变数组某元素内的嵌套属性不会刷新touch bar。
touchBarScrubber.selectedStyle
一个string,用来表示在scrubber内被选择的组件应有的样式。 改变这个值会立刻刷新touch bar内的控件。 可选值:
background- 映射为[NSScrubberSelectionStyle roundedBackgroundStyle]outline- 映射为[NSScrubberSelectionStyle outlineOverlayStyle]none- 移除所有样式。
touchBarScrubber.overlayStyle
一个string,用来表示在scrubber内被选择的组件应有的样式。 This style is overlaid on top of the scrubber item instead of being placed behind it. 改变这个值会立刻刷新touch bar的控件。 可选值:
background- 映射为[NSScrubberSelectionStyle roundedBackgroundStyle]outline- 映射为[NSScrubberSelectionStyle outlineOverlayStyle]none- 移除所有样式。
touchBarScrubber.showArrowButtons
一个 boolean 值,表示是否在此 scrubber 中显示左/右选择箭头。 更新此值会立即更新 touch bar 中的控件。
touchBarScrubber.mode
一个 string 值,表示 scrubber 的模式。 改变这个值会立刻刷新touch bar内的控件。 可选值:
fixed- 映射到NSScrubberModeFixedfree- 映射到NSScrubberModeFree.
touchBarScrubber.continuous
一个 boolean 值,表示此 scrubber 是否是连续的。 改变这个值会立刻刷新touch bar内的控件。