mirror of
https://github.com/heyman/heynote.git
synced 2024-12-22 23:00:38 +01:00
Set window title to name of current buffer
#build
This commit is contained in:
parent
b7a1b185a8
commit
146e33ef3f
@ -359,6 +359,9 @@ ipcMain.handle('dark-mode:set', (event, mode) => {
|
|||||||
|
|
||||||
ipcMain.handle('dark-mode:get', () => nativeTheme.themeSource)
|
ipcMain.handle('dark-mode:get', () => nativeTheme.themeSource)
|
||||||
|
|
||||||
|
ipcMain.handle("setWindowTitle", (event, title) => {
|
||||||
|
win?.setTitle(title)
|
||||||
|
})
|
||||||
|
|
||||||
// Initialize note/file library
|
// Initialize note/file library
|
||||||
async function initFileLibrary(win) {
|
async function initFileLibrary(win) {
|
||||||
|
@ -161,6 +161,10 @@ contextBridge.exposeInMainWorld("heynote", {
|
|||||||
async getInitErrors() {
|
async getInitErrors() {
|
||||||
return await ipcRenderer.invoke("getInitErrors")
|
return await ipcRenderer.invoke("getInitErrors")
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setWindowTitle(title) {
|
||||||
|
ipcRenderer.invoke("setWindowTitle", title)
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,11 +74,16 @@
|
|||||||
currentBufferPath() {
|
currentBufferPath() {
|
||||||
this.focusEditor()
|
this.focusEditor()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
currentBufferName() {
|
||||||
|
window.heynote.setWindowTitle(this.currentBufferName)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(useHeynoteStore, [
|
...mapState(useHeynoteStore, [
|
||||||
"currentBufferPath",
|
"currentBufferPath",
|
||||||
|
"currentBufferName",
|
||||||
"showLanguageSelector",
|
"showLanguageSelector",
|
||||||
"showBufferSelector",
|
"showBufferSelector",
|
||||||
"showCreateBuffer",
|
"showCreateBuffer",
|
||||||
|
@ -414,7 +414,7 @@ export function triggerCursorChange({state, dispatch}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const emitCursorChange = (editor) => {
|
const emitCursorChange = (editor) => {
|
||||||
const notesStore = useHeynoteStore()
|
const heynoteStore = useHeynoteStore()
|
||||||
return ViewPlugin.fromClass(
|
return ViewPlugin.fromClass(
|
||||||
class {
|
class {
|
||||||
update(update) {
|
update(update) {
|
||||||
@ -430,11 +430,11 @@ const emitCursorChange = (editor) => {
|
|||||||
|
|
||||||
const block = getActiveNoteBlock(update.state)
|
const block = getActiveNoteBlock(update.state)
|
||||||
if (block && cursorLine) {
|
if (block && cursorLine) {
|
||||||
notesStore.currentCursorLine = cursorLine
|
heynoteStore.currentCursorLine = cursorLine
|
||||||
notesStore.currentSelectionSize = selectionSize
|
heynoteStore.currentSelectionSize = selectionSize
|
||||||
notesStore.currentLanguage = block.language.name
|
heynoteStore.currentLanguage = block.language.name
|
||||||
notesStore.currentLanguageAuto = block.language.auto
|
heynoteStore.currentLanguageAuto = block.language.auto
|
||||||
notesStore.currentBufferName = editor.name
|
heynoteStore.currentBufferName = editor.name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -260,6 +260,10 @@ const Heynote = {
|
|||||||
async getInitErrors() {
|
async getInitErrors() {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setWindowTitle(title) {
|
||||||
|
document.title = title + " - Heynote"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export { Heynote, ipcRenderer}
|
export { Heynote, ipcRenderer}
|
||||||
|
Loading…
Reference in New Issue
Block a user