From 3290727d88805beb79795f72139bd13b35039b4d Mon Sep 17 00:00:00 2001 From: "Flora (opencode)" Date: Mon, 17 Aug 2026 16:15:39 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81:=20=D1=82=D0=B0=D0=B9?= =?UTF-8?q?=D0=BC=D0=B5=D1=80=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B5=D0=BD=D1=82=D0=B0=20(30?= =?UTF-8?q?ms=20debounce=20=D0=B4=D0=BB=D1=8F=20editorContent),=20=D1=82?= =?UTF-8?q?=D0=BE=D1=87=D0=BA=D0=B8=20=D0=BA=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4?= =?UTF-8?q?=D0=B0=D1=80=D1=8F=20=E2=80=94=20=D0=BF=D1=80=D0=B8=D0=B2=D1=8F?= =?UTF-8?q?=D0=B7=D0=BA=D0=B0=20=D0=BA=20cal.currentMonth=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BA=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82=D0=BD=D0=BE?= =?UTF-8?q?=D0=B3=D0=BE=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D1=80=D0=B8=20=D1=81=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=20=D0=BC=D0=B5=D1=81=D1=8F=D1=86=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qml/panels/EditorPane.qml | 21 +++++++++++++++------ qml/panels/MonthCalendar.qml | 2 ++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/qml/panels/EditorPane.qml b/qml/panels/EditorPane.qml index 434b4f7..fb9a105 100644 --- a/qml/panels/EditorPane.qml +++ b/qml/panels/EditorPane.qml @@ -316,12 +316,21 @@ Item { onDocIndexChanged: { pane.refreshHeader() pane.renderView() - if (pane.docIndex >= 0) { - pane.editorContent = documentManager.contentAt(pane.docIndex) - if (pane.editMode) - editor.forceActiveFocus() - } else { - pane.editorContent = "" + loadTimer.start() + } + + // Таймер для надёжной загрузки контента (обходит тайминг layout/QML) + Timer { + id: loadTimer + interval: 30 + onTriggered: { + if (pane.docIndex >= 0) { + pane.editorContent = documentManager.contentAt(pane.docIndex) + if (pane.editMode) + editor.forceActiveFocus() + } else { + pane.editorContent = "" + } } } onEditModeChanged: { diff --git a/qml/panels/MonthCalendar.qml b/qml/panels/MonthCalendar.qml index da0ca78..e486c0c 100644 --- a/qml/panels/MonthCalendar.qml +++ b/qml/panels/MonthCalendar.qml @@ -90,6 +90,8 @@ Item { // Проверяем, есть ли заметка за этот день readonly property bool hasNote: { + // Явная зависимость от currentMonth — пересчитываем при смене месяца + const _ = cal.currentMonth if (modelData <= 0 || !fileStore.ready) return false const ds = Qt.formatDate(new Date(cal.year, cal.month, modelData), "yyyy-MM-dd") return fileStore.fileExists(fileStore.vault + "/Журнал/" + ds + ".md")