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

Cleaned up menu items ordering and separators, added clone note menu item and shortcut, updated focus note shortcut to be mac friendly, made delete note shortcut use either command+backspace or ctrl+backspace and the delete key on windows and linux machines

This commit is contained in:
William Grant
2018-12-02 15:59:47 +02:00
parent 0f5d753910
commit 5d54ad3342
2 changed files with 35 additions and 36 deletions

View File

@@ -71,6 +71,7 @@ class NoteList extends React.Component {
this.jumpNoteByHash = this.jumpNoteByHashHandler.bind(this)
this.handleNoteListKeyUp = this.handleNoteListKeyUp.bind(this)
this.getNoteKeyFromTargetIndex = this.getNoteKeyFromTargetIndex.bind(this)
this.cloneNote = this.cloneNote.bind(this)
this.deleteNote = this.deleteNote.bind(this)
this.focusNote = this.focusNote.bind(this)
this.pinToTop = this.pinToTop.bind(this)
@@ -96,6 +97,7 @@ class NoteList extends React.Component {
this.refreshTimer = setInterval(() => this.forceUpdate(), 60 * 1000)
ee.on('list:next', this.selectNextNoteHandler)
ee.on('list:prior', this.selectPriorNoteHandler)
ee.on('list:clone', this.cloneNote)
ee.on('list:focus', this.focusHandler)
ee.on('list:isMarkdownNote', this.alertIfSnippetHandler)
ee.on('import:file', this.importFromFileHandler)
@@ -118,6 +120,7 @@ class NoteList extends React.Component {
ee.off('list:next', this.selectNextNoteHandler)
ee.off('list:prior', this.selectPriorNoteHandler)
ee.off('list:clone', this.cloneNote)
ee.off('list:focus', this.focusHandler)
ee.off('list:isMarkdownNote', this.alertIfSnippetHandler)
ee.off('import:file', this.importFromFileHandler)

View File

@@ -85,14 +85,40 @@ const file = {
},
{
label: 'Focus Note',
accelerator: 'Control+E',
accelerator: macOS ? 'Command+E' : 'Control+E',
click () {
mainWindow.webContents.send('detail:focus')
}
},
{
label: 'Delete Note',
accelerator: macOS ? '' : 'Delete',
accelerator: macOS ? 'Command+Backspace' : 'Control+Backspace',
click () {
mainWindow.webContents.send('detail:delete')
}
},
{
label: 'Clone Note',
accelerator: macOS ? 'Command+D' : 'Control+D',
click () {
mainWindow.webContents.send('list:clone')
}
},
{
type: 'separator'
},
{
label: 'Import from',
submenu: [
{
label: 'Plain Text, MarkDown (.txt, .md)',
click () {
mainWindow.webContents.send('import:file')
}
}
]
},
{
label: 'Export as',
submenu: [
@@ -123,18 +149,11 @@ const file = {
type: 'separator'
},
{
label: 'Import from',
submenu: [
{
label: 'Plain Text, MarkDown (.txt, .md)',
click () {
mainWindow.webContents.send('import:file')
}
}
]
},
{
type: 'separator'
label: 'Generate/Update Markdown TOC',
accelerator: 'Shift+Ctrl+T',
click () {
mainWindow.webContents.send('code:generate-toc')
}
},
{
label: 'Format Table',
@@ -145,16 +164,6 @@ const file = {
{
type: 'separator'
},
{
label: 'Generate/Update Markdown TOC',
accelerator: 'Shift+Ctrl+T',
click () {
mainWindow.webContents.send('code:generate-toc')
}
},
{
type: 'separator'
},
{
label: 'Print',
accelerator: 'CommandOrControl+P',
@@ -162,16 +171,6 @@ const file = {
mainWindow.webContents.send('list:isMarkdownNote')
mainWindow.webContents.send('print')
}
},
{
type: 'separator'
},
{
label: 'Delete Note',
accelerator: macOS ? 'Control+Backspace' : 'Control+Delete',
click () {
mainWindow.webContents.send('detail:delete')
}
}
]
}
@@ -296,9 +295,6 @@ const view = {
mainWindow.setFullScreen(!mainWindow.isFullScreen())
}
},
{
type: 'separator'
},
{
label: 'Toggle Side Bar',
accelerator: 'CommandOrControl+B',