mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
init touchbar menu
This commit is contained in:
@@ -78,9 +78,11 @@ app.on('ready', function () {
|
||||
|
||||
var template = require('./main-menu')
|
||||
var menu = Menu.buildFromTemplate(template)
|
||||
var touchBarMenu = require('./touchbar-menu')
|
||||
switch (process.platform) {
|
||||
case 'darwin':
|
||||
Menu.setApplicationMenu(menu)
|
||||
mainWindow.setTouchBar(touchBarMenu)
|
||||
break
|
||||
case 'win32':
|
||||
mainWindow.setMenu(menu)
|
||||
|
||||
26
lib/touchbar-menu.js
Normal file
26
lib/touchbar-menu.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const {TouchBar} = require('electron')
|
||||
const {TouchBarButton, TouchBarSpacer} = TouchBar
|
||||
|
||||
const allNotes = new TouchBarButton({
|
||||
label: '📒',
|
||||
click: () => {}
|
||||
})
|
||||
|
||||
const starredNotes = new TouchBarButton({
|
||||
label: '⭐️',
|
||||
click: () => {}
|
||||
})
|
||||
|
||||
const trash = new TouchBarButton({
|
||||
label: '🗑',
|
||||
click: () => {}
|
||||
})
|
||||
|
||||
module.exports = new TouchBar([
|
||||
allNotes,
|
||||
new TouchBarSpacer({size: 'small'}),
|
||||
starredNotes,
|
||||
new TouchBarSpacer({size: 'small'}),
|
||||
trash
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user