Add Slider item type and add options to the button type

This commit is contained in:
Samuel Attard 2016-11-28 21:43:39 +11:00 committed by Kevin Sawicki
parent 18c7c3ece8
commit c92c4138a8
5 changed files with 191 additions and 53 deletions

View file

@ -28,6 +28,8 @@ exports.load = (appUrl) => {
mainWindow.setTouchBar(new TouchBar([
new (TouchBar.Button)({
label: 'Hello World!',
backgroundColor: "DDDDDD",
labelColor: "000000",
click: () => {
console.log('Hello World Clicked')
}
@ -36,10 +38,18 @@ exports.load = (appUrl) => {
label: 'This is a Label'
}),
new (TouchBar.ColorPicker)({
change: (...args) => {
console.log('Color was changed', ...args)
change: (newColor) => {
console.log('Color was changed', newColor)
}
})
}),
new (TouchBar.Slider)({
label: 'Slider 123',
minValue: 50,
maxValue: 1000,
change: (newVal) => {
console.log('Slider was changed', newVal, typeof newVal)
}
}),
]))
})
}