mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
send events when user click touchbar buttons
This commit is contained in:
@@ -1,19 +1,33 @@
|
||||
const {TouchBar} = require('electron')
|
||||
const {TouchBarButton, TouchBarSpacer} = TouchBar
|
||||
const mainWindow = require('./main-window')
|
||||
|
||||
const allNotes = new TouchBarButton({
|
||||
label: '📒',
|
||||
click: () => {}
|
||||
click: () => {
|
||||
mainWindow.webContents.send('list:navigate', '/home')
|
||||
}
|
||||
})
|
||||
|
||||
const starredNotes = new TouchBarButton({
|
||||
label: '⭐️',
|
||||
click: () => {}
|
||||
click: () => {
|
||||
mainWindow.webContents.send('list:navigate', '/starred')
|
||||
}
|
||||
})
|
||||
|
||||
const trash = new TouchBarButton({
|
||||
label: '🗑',
|
||||
click: () => {}
|
||||
click: () => {
|
||||
mainWindow.webContents.send('list:navigate', '/trashed')
|
||||
}
|
||||
})
|
||||
|
||||
const newNote = new TouchBarButton({
|
||||
label: '✎',
|
||||
click: () => {
|
||||
mainWindow.webContents.send('top:new-note')
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = new TouchBar([
|
||||
@@ -21,6 +35,8 @@ module.exports = new TouchBar([
|
||||
new TouchBarSpacer({size: 'small'}),
|
||||
starredNotes,
|
||||
new TouchBarSpacer({size: 'small'}),
|
||||
trash
|
||||
trash,
|
||||
new TouchBarSpacer({size: 'large'}),
|
||||
newNote
|
||||
])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user