update
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user