1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Add search clear options; closes #1525

This commit is contained in:
Sander Steenhuis
2018-02-26 16:07:27 +01:00
parent fb7280127c
commit 6502158716
6 changed files with 96 additions and 13 deletions

View File

@@ -1,6 +1,7 @@
const electron = require('electron')
const BrowserWindow = electron.BrowserWindow
const shell = electron.shell
const ipc = electron.ipcMain
const mainWindow = require('./main-window')
const macOS = process.platform === 'darwin'
@@ -259,6 +260,23 @@ const view = {
]
}
let editorFocused
// Define extra shortcut keys
mainWindow.webContents.on('before-input-event', (event, input) => {
// Synonyms for Search (Find)
if (input.control && input.key === 'f' && input.type === 'keyDown') {
if (!editorFocused) {
mainWindow.webContents.send('top:focus-search')
event.preventDefault()
}
}
})
ipc.on('editor:focused', (event, isFocused) => {
editorFocused = isFocused
})
const window = {
label: 'Window',
submenu: [