diff --git a/disable-readonly-mode/disable-readonly-mode.qml b/disable-readonly-mode/disable-readonly-mode.qml new file mode 100644 index 0000000..8b4c892 --- /dev/null +++ b/disable-readonly-mode/disable-readonly-mode.qml @@ -0,0 +1,20 @@ +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(); + } +} diff --git a/disable-readonly-mode/info.json b/disable-readonly-mode/info.json new file mode 100644 index 0000000..bea81e7 --- /dev/null +++ b/disable-readonly-mode/info.json @@ -0,0 +1,9 @@ +{ + "name": "Disable read-only mode", + "identifier": "disable-readonly-mode", + "script": "disable-readonly-mode.qml", + "authors": ["@pbek"], + "version": "1.0.0", + "minAppVersion": "18.08.1", + "description" : "This script will disable the read-only mode if a note is double clicked. The note text edit will also be focused afterwards." +}