Фикс: таймер загрузки контента (30ms debounce для editorContent), точки календаря — привязка к cal.currentMonth для корректного обновления при смене месяца
This commit is contained in:
@@ -316,6 +316,14 @@ Item {
|
|||||||
onDocIndexChanged: {
|
onDocIndexChanged: {
|
||||||
pane.refreshHeader()
|
pane.refreshHeader()
|
||||||
pane.renderView()
|
pane.renderView()
|
||||||
|
loadTimer.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Таймер для надёжной загрузки контента (обходит тайминг layout/QML)
|
||||||
|
Timer {
|
||||||
|
id: loadTimer
|
||||||
|
interval: 30
|
||||||
|
onTriggered: {
|
||||||
if (pane.docIndex >= 0) {
|
if (pane.docIndex >= 0) {
|
||||||
pane.editorContent = documentManager.contentAt(pane.docIndex)
|
pane.editorContent = documentManager.contentAt(pane.docIndex)
|
||||||
if (pane.editMode)
|
if (pane.editMode)
|
||||||
@@ -324,6 +332,7 @@ Item {
|
|||||||
pane.editorContent = ""
|
pane.editorContent = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
onEditModeChanged: {
|
onEditModeChanged: {
|
||||||
if (!pane.editMode)
|
if (!pane.editMode)
|
||||||
pane.renderView()
|
pane.renderView()
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ Item {
|
|||||||
|
|
||||||
// Проверяем, есть ли заметка за этот день
|
// Проверяем, есть ли заметка за этот день
|
||||||
readonly property bool hasNote: {
|
readonly property bool hasNote: {
|
||||||
|
// Явная зависимость от currentMonth — пересчитываем при смене месяца
|
||||||
|
const _ = cal.currentMonth
|
||||||
if (modelData <= 0 || !fileStore.ready) return false
|
if (modelData <= 0 || !fileStore.ready) return false
|
||||||
const ds = Qt.formatDate(new Date(cal.year, cal.month, modelData), "yyyy-MM-dd")
|
const ds = Qt.formatDate(new Date(cal.year, cal.month, modelData), "yyyy-MM-dd")
|
||||||
return fileStore.fileExists(fileStore.vault + "/Журнал/" + ds + ".md")
|
return fileStore.fileExists(fileStore.vault + "/Журнал/" + ds + ".md")
|
||||||
|
|||||||
Reference in New Issue
Block a user