mirror of
https://github.com/heyman/heynote.git
synced 2025-06-28 13:31:38 +02:00
Add menu item to open "Move block" dialog
This commit is contained in:
parent
c9c092fc43
commit
6187d6d468
@ -1,5 +1,5 @@
|
|||||||
const { app, Menu } = require("electron")
|
const { app, Menu } = require("electron")
|
||||||
import { OPEN_SETTINGS_EVENT, REDO_EVENT } from '@/src/common/constants'
|
import { OPEN_SETTINGS_EVENT, REDO_EVENT, MOVE_BLOCK_EVENT } from '@/src/common/constants'
|
||||||
import { openAboutWindow } from "./about";
|
import { openAboutWindow } from "./about";
|
||||||
import { quit } from "./index"
|
import { quit } from "./index"
|
||||||
|
|
||||||
@ -63,13 +63,19 @@ const template = [
|
|||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
submenu: [
|
submenu: [
|
||||||
{ role: 'undo' },
|
{ role: 'undo' },
|
||||||
//{ role: 'undo' },
|
|
||||||
{
|
{
|
||||||
label: 'Redo',
|
label: 'Redo',
|
||||||
accelerator: 'CommandOrControl+Shift+z',
|
accelerator: 'CommandOrControl+Shift+z',
|
||||||
click: (menuItem, window, event) => {
|
click: (menuItem, window, event) => {
|
||||||
window?.webContents.send(REDO_EVENT)
|
window?.webContents.send(REDO_EVENT)
|
||||||
console.log("redo")
|
},
|
||||||
|
},
|
||||||
|
{ type: 'separator' },
|
||||||
|
{
|
||||||
|
label: 'Move block to another buffer...',
|
||||||
|
accelerator: 'CommandOrControl+S',
|
||||||
|
click: (menuItem, window, event) => {
|
||||||
|
window?.webContents.send(MOVE_BLOCK_EVENT)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
|
@ -5,6 +5,7 @@ export const WINDOW_CLOSE_EVENT = "window-close"
|
|||||||
export const OPEN_SETTINGS_EVENT = "open-settings"
|
export const OPEN_SETTINGS_EVENT = "open-settings"
|
||||||
export const SETTINGS_CHANGE_EVENT = "settings-change"
|
export const SETTINGS_CHANGE_EVENT = "settings-change"
|
||||||
export const REDO_EVENT = "redo"
|
export const REDO_EVENT = "redo"
|
||||||
|
export const MOVE_BLOCK_EVENT = "move-block"
|
||||||
|
|
||||||
export const UPDATE_AVAILABLE_EVENT = "update-available"
|
export const UPDATE_AVAILABLE_EVENT = "update-available"
|
||||||
export const UPDATE_NOT_AVAILABLE_EVENT = "update-not-available"
|
export const UPDATE_NOT_AVAILABLE_EVENT = "update-not-available"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
import { useSettingsStore } from "../stores/settings-store"
|
import { useSettingsStore } from "../stores/settings-store"
|
||||||
import { useEditorCacheStore } from '../stores/editor-cache'
|
import { useEditorCacheStore } from '../stores/editor-cache'
|
||||||
|
|
||||||
import { OPEN_SETTINGS_EVENT, SETTINGS_CHANGE_EVENT } from '@/src/common/constants'
|
import { OPEN_SETTINGS_EVENT, MOVE_BLOCK_EVENT } from '@/src/common/constants'
|
||||||
|
|
||||||
import StatusBar from './StatusBar.vue'
|
import StatusBar from './StatusBar.vue'
|
||||||
import Editor from './Editor.vue'
|
import Editor from './Editor.vue'
|
||||||
@ -44,6 +44,10 @@
|
|||||||
window.heynote.mainProcess.on(OPEN_SETTINGS_EVENT, () => {
|
window.heynote.mainProcess.on(OPEN_SETTINGS_EVENT, () => {
|
||||||
this.showSettings = true
|
this.showSettings = true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
window.heynote.mainProcess.on(MOVE_BLOCK_EVENT, (path) => {
|
||||||
|
this.openMoveToBufferSelector()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
@ -77,6 +81,7 @@
|
|||||||
"showCreateBuffer",
|
"showCreateBuffer",
|
||||||
"showEditBuffer",
|
"showEditBuffer",
|
||||||
"showMoveToBufferSelector",
|
"showMoveToBufferSelector",
|
||||||
|
"openMoveToBufferSelector",
|
||||||
]),
|
]),
|
||||||
|
|
||||||
editorInert() {
|
editorInert() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user