Files
Flora/qml/MainWindow.qml
T

106 lines
3.6 KiB
QML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
// Главное окно: меню вверху, три панели (дерево / редактор / правая).
// Фаза 0: каркас. Содержимое панелей наполняется в следующих фазах.
ApplicationWindow {
id: window
width: 1280
height: 800
visible: true
title: "Flora"
color: "white"
menuBar: MenuBar {
Menu {
title: qsTr("&Файл")
Action { text: qsTr("Открыть хранилище…"); onTriggered: vaultSwitcher.open() }
Menu {
title: qsTr("Экспорт")
Action { text: qsTr("В HTML…"); enabled: false }
Action { text: qsTr("В PDF…"); enabled: false }
}
MenuSeparator { }
Action { text: qsTr("Выход"); onTriggered: window.close() }
}
Menu {
title: qsTr("&Правка")
Action { text: qsTr("Отменить"); shortcut: "Ctrl+Z"; enabled: false }
Action { text: qsTr("Повторить"); shortcut: "Ctrl+Shift+Z"; enabled: false }
MenuSeparator { }
Action {
text: qsTr("Вернуться к предыдущей версии…"); enabled: false
// Диалог истории с diff-режимом — Фаза 9.
}
}
Menu {
title: qsTr("&Вид")
Action { text: qsTr("Светлая тема"); checkable: true; checked: true }
Action { text: qsTr("Тёмная тема"); checkable: true }
}
Menu {
title: qsTr("&Справка")
Action {
text: qsTr("О программе")
onTriggered: aboutDialog.open()
}
}
}
Dialog {
id: aboutDialog
title: qsTr("О программе")
standardButtons: Dialog.Ok
modal: true
anchors.centerIn: parent
Label {
text: "Flora\nМинималистичный markdown-заметочник (GPL-3.0)\n"
+ "Версия " + Qt.application.version
}
}
Popup {
id: vaultSwitcher
x: 12
y: window.height - height - 12
width: 280
modal: false
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
ColumnLayout {
width: parent.width
Label { text: qsTr("Хранилища (Фаза 2)") }
Button { text: qsTr("Это окно: %1").arg(vaultManager.currentVault) }
Button {
text: qsTr("Добавить новое хранилище…")
onClicked: { vaultSwitcher.close(); vaultManager.setCurrentVault("/") }
}
}
}
SplitView {
anchors.fill: parent
orientation: Qt.Horizontal
FileTreePanel {
id: leftPanel
SplitView.preferredWidth: window.width * 0.15
SplitView.minimumWidth: 120
SplitView.maximumWidth: 500
onOpenVaultRequested: vaultSwitcher.open()
onNewFileRequested: console.log("Новый файл (Фаза 3)")
onNewFolderRequested: console.log("Новая папка (Фаза 3)")
}
EditorPanel {
SplitView.fillWidth: true
SplitView.minimumWidth: 300
}
RightPanel {
SplitView.preferredWidth: window.width * 0.15
SplitView.minimumWidth: 140
SplitView.maximumWidth: 500
}
}
}