2017-03-13 11:00:25 +11:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## Class: TouchBarScrubber
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 14:02:48 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								> Create a scrubber (a scrollable selector)
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-13 11:00:25 +11:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-15 13:50:31 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Process: [Main](../glossary.md#main-process)<br />
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-13 11:00:25 +11:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-04-02 09:32:18 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								### `new TouchBarScrubber(options)`
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-13 11:00:25 +11:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* `options` Object
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-29 11:38:35 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  * `items` [ScrubberItem[]](structures/scrubber-item.md) - An array of items to place in this scrubber.
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-25 11:30:42 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  * `select` Function (optional) - Called when the user taps an item that was not the last tapped item.
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-29 11:38:35 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    * `selectedIndex` Integer - The index of the item the user selected.
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-25 11:30:42 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  * `highlight` Function (optional) - Called when the user taps any item.
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-29 11:38:35 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    * `highlightedIndex` Integer - The index of the item the user touched.
							 | 
						
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  * `selectedStyle` string (optional) - Selected item style. Can be `background`, `outline` or `none`. Defaults to `none`.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  * `overlayStyle` string (optional) - Selected overlay item style. Can be `background`, `outline` or `none`. Defaults to `none`.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  * `showArrowButtons` boolean (optional) - Whether to show arrow buttons. Defaults to `false` and is only shown if `items` is non-empty.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  * `mode` string (optional) - Can be `fixed` or `free`. The default is `free`.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  * `continuous` boolean (optional) - Defaults to `true`.
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-13 11:00:25 +11:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								### Instance Properties
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The following properties are available on instances of `TouchBarScrubber`:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-27 07:51:19 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#### `touchBarScrubber.items`
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-13 11:00:25 +11:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 14:12:41 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								A `ScrubberItem[]` array representing the items in this scrubber. Updating this value immediately
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								updates the control in the touch bar. Updating deep properties inside this array **does not update the touch bar**.
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 18:57:57 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-27 07:51:19 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#### `touchBarScrubber.selectedStyle`
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 18:57:57 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								A `string` representing the style that selected items in the scrubber should have. Updating this value immediately
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-29 11:58:24 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								updates the control in the touch bar. Possible values:
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 18:57:57 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-29 11:38:35 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* `background` - Maps to `[NSScrubberSelectionStyle roundedBackgroundStyle]`.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* `outline` - Maps to `[NSScrubberSelectionStyle outlineOverlayStyle]`.
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-01 16:59:26 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* `none` - Removes all styles.
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 18:57:57 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-27 07:51:19 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#### `touchBarScrubber.overlayStyle`
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 18:57:57 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								A `string` representing the style that selected items in the scrubber should have. This style is overlayed on top
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 14:12:41 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								of the scrubber item instead of being placed behind it. Updating this value immediately updates the control in the
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-29 11:58:24 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								touch bar. Possible values:
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 18:57:57 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-29 11:38:35 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* `background` - Maps to `[NSScrubberSelectionStyle roundedBackgroundStyle]`.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* `outline` - Maps to `[NSScrubberSelectionStyle outlineOverlayStyle]`.
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-01 16:59:26 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* `none` - Removes all styles.
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 18:57:57 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-27 07:51:19 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#### `touchBarScrubber.showArrowButtons`
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 18:57:57 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								A `boolean` representing whether to show the left / right selection arrows in this scrubber. Updating this value
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-29 11:58:24 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								immediately updates the control in the touch bar.
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 18:57:57 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-27 07:51:19 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#### `touchBarScrubber.mode`
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 18:57:57 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								A `string` representing the mode of this scrubber. Updating this value immediately
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 14:12:41 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								updates the control in the touch bar. Possible values:
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 18:57:57 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-29 11:38:35 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								* `fixed` - Maps to `NSScrubberModeFixed`.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								* `free` - Maps to `NSScrubberModeFree`.
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 18:57:57 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-07-27 07:51:19 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#### `touchBarScrubber.continuous`
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 18:57:57 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-11-16 05:13:18 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								A `boolean` representing whether this scrubber is continuous or not. Updating this value immediately
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 14:02:48 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								updates the control in the touch bar.
							 |