This commit is contained in:
team3
2026-09-19 20:59:47 +02:00
parent 45a6ecf654
commit 4548178a7c
20 changed files with 832 additions and 23 deletions

View File

@@ -61,6 +61,11 @@ class NotesPanel extends St.BoxLayout {
return Clutter.EVENT_STOP;
});
this.connect('destroy', () => this._stopAutosave());
// Änderungen vom Sync. Während des Tippens bleibt der Editor, wie er ist.
store.onChange(() => {
if (!this._editing)
this._refresh();
});
this._refresh();
}
@@ -143,8 +148,10 @@ class NotesPanel extends St.BoxLayout {
if (this._editing || this._selected?.type !== 'note')
return;
this._editing = true;
this._dirty = false;
this._store.lockedNote = this._selected.path;
this._editor.set_text(this._store.readNote(this._selected.path));
// Erst nach set_text, das löst selbst text-changed aus. Sonst gilt jedes Öffnen als Änderung.
this._dirty = false;
this._viewScroll.hide();
this._editScroll.show();
this._editor.clutter_text.grab_key_focus();
@@ -184,7 +191,9 @@ class NotesPanel extends St.BoxLayout {
return;
this._flush();
this._editing = false;
this._store.lockedNote = null;
this._stopAutosave();
// Nur die Anzeige wechseln. Ein Neuaufbau des Baums würde die gerade geklickte Zeile zerstören.
this._showSelected();
}
@@ -265,6 +274,7 @@ class NotesPanel extends St.BoxLayout {
_delete(type, node) {
if (this._selected?.path === node.path) {
this._editing = false;
this._store.lockedNote = null;
this._stopAutosave();
this._selected = null;
}