QOwnNotes/docs/scripting/examples/disable-readonly-mode.qml
2020-10-08 18:56:02 +02:00

20 lines
525 B
QML

import QtQml 2.0
import QOwnNotesTypes 1.0
/**
* This script will disable the read-only mode if a note is double clicked
*/
Script {
/**
* This function is called after a note was double clicked
*
* @param {NoteApi} note - the note object that was clicked
*/
function noteDoubleClickedHook(note) {
// disable the read-only mode
script.triggerMenuAction("actionAllow_note_editing", 1);
// focus the note text edit
mainWindow.focusNoteTextEdit();
}
}