Fix: color:text на TextArea, автооткрытие первого .md файла, отладка цепочки openDocument→setActiveIndex→loadContent→editor.text (проверено: контент загружается, editor.text.length=21)

This commit is contained in:
Flora (opencode)
2026-08-17 17:29:23 +03:00
parent 795d9e52df
commit 18962473ae
3 changed files with 29 additions and 1 deletions
+3
View File
@@ -31,6 +31,9 @@ qt_standard_project_setup(REQUIRES 6.4)
qt_policy(SET QTP0001 NEW)
qt_policy(SET QTP0004 NEW)
# Отключаем AOT-компиляцию QML — гарантирует что QML-изменения подхватываются сразу.
set(QML_COMPILER_ENABLE_AOT OFF)
# Сторонние библиотеки как подпроекты (FetchContent).
include(${CMAKE_CURRENT_SOURCE_DIR}/third_party/deps.cmake)
+23 -1
View File
@@ -53,8 +53,30 @@ ApplicationWindow {
fileStore.openVault(vaultManager.currentVault)
}
// Если хранилищ нет — мастер откроется автоматически.
if (vaultManager.vaults.length === 0)
if (vaultManager.vaults.length === 0) {
welcomeWizard.open()
} else {
// Автооткрытие первого .md файла для тестирования
autoOpenTimer.start()
}
}
Timer {
id: autoOpenTimer
interval: 200
onTriggered: {
if (!fileStore.ready) return
for (let i = 0; i < fileStore.rowCount(); i++) {
if (!fileStore.itemIsDir(i)) {
const p = fileStore.itemPath(i)
if (p.endsWith(".md")) {
documentManager.openDocument(p)
console.log("AUTO-OPENED:", p, "len:", documentManager.contentAt(documentManager.activeIndex).length)
break
}
}
}
}
}
menuBar: MenuBar {
+3
View File
@@ -2,6 +2,8 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
// qml-disable-aot
// Панель одного документа: шапка (заголовок, режим, действия) + текст.
// Режимы: редактирование (TextArea) / просмотр (read-only TextArea).
Item {
@@ -224,6 +226,7 @@ Item {
id: editor
anchors.fill: parent
visible: pane.editMode
color: "black"
onTextEdited: documentManager.updateContent(pane.docIndex, text)
selectByMouse: true
font.family: "Menlo, Consolas, 'DejaVu Sans Mono', monospace"