diff --git a/CMakeLists.txt b/CMakeLists.txt index a7e25eb..d6d1b72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/qml/MainWindow.qml b/qml/MainWindow.qml index 196c9b2..06c6211 100644 --- a/qml/MainWindow.qml +++ b/qml/MainWindow.qml @@ -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 { diff --git a/qml/panels/EditorPane.qml b/qml/panels/EditorPane.qml index 61b312b..3e4f814 100644 --- a/qml/panels/EditorPane.qml +++ b/qml/panels/EditorPane.qml @@ -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"