Fix: color:text на TextArea, автооткрытие первого .md файла, отладка цепочки openDocument→setActiveIndex→loadContent→editor.text (проверено: контент загружается, editor.text.length=21)
This commit is contained in:
@@ -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
@@ -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 {
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user