From cfb3798703f262d9a3a94b9442aedfb8151eb3cd Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Mon, 13 Mar 2017 11:00:25 +1100 Subject: [PATCH] Add docs for TouchBarScrubbber --- docs/api/structures/scrubber-item.md | 4 ++++ docs/api/touch-bar-scrubber.md | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 docs/api/structures/scrubber-item.md create mode 100644 docs/api/touch-bar-scrubber.md diff --git a/docs/api/structures/scrubber-item.md b/docs/api/structures/scrubber-item.md new file mode 100644 index 000000000000..b1711cec1cef --- /dev/null +++ b/docs/api/structures/scrubber-item.md @@ -0,0 +1,4 @@ +# ScrubberItem Object + +* `label` String - (Optional) The text to appear in this item +* `image` NativeImage - (Optional) The image to appear in this item diff --git a/docs/api/touch-bar-scrubber.md b/docs/api/touch-bar-scrubber.md new file mode 100644 index 000000000000..3143e95305f5 --- /dev/null +++ b/docs/api/touch-bar-scrubber.md @@ -0,0 +1,23 @@ +## Class: TouchBarScrubber + +> Create a scrubber (a scrollablbe selector) + +Process: [Main](../tutorial/quick-start.md#main-process) + +### `new TouchBarScrubber(options)` + +* `options` Object + * `items` [ScrubberItem[]](structures/scrubber-item.md) - An array of items to place in this scruber + * `onSelect` Function - Called when the user taps an item that was not the last tapped item + * `selectedIndex` - The index of the item the user selected + * `onHightlight` Function - Called when the user taps any item + * `highlightedIndex` - The index of the item the user touched + +### Instance Properties + +The following properties are available on instances of `TouchBarScrubber`: + +#### `touchBarSegmentedControl.items` + +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**.