Files
Flora/qml/panels/FileTreePanel.qml
T

85 lines
2.5 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
// Левая панель: файловое дерево. Фаза 0 — каркас:
// кнопка «+» над деревом с меню-бутербродом («Файл»/«Папка»),
// кнопка хранилища внизу слева. Само дерево и операции — Фаза 3.
Item {
id: root
signal openVaultRequested()
signal newFileRequested()
signal newFolderRequested()
ColumnLayout {
anchors.fill: parent
spacing: 0
// Заголовок панели: кнопка «+» + название
Rectangle {
Layout.fillWidth: true
implicitHeight: 36
color: "whitesmoke"
RowLayout {
anchors.fill: parent
anchors.leftMargin: 4
spacing: 4
Button {
id: addButton
text: "+"
implicitWidth: 28
implicitHeight: 26
ToolTip.visible: hovered
ToolTip.text: qsTr("Создать")
onClicked: addMenu.popup()
}
Label {
text: qsTr("Файлы")
Layout.fillWidth: true
elide: Text.ElideRight
color: "#555"
}
}
}
// Место файлового дерева (Фаза 3)
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
color: "#fafafa"
Label {
anchors.centerIn: parent
text: qsTr("Дерево файлов\n(Фаза 3)")
horizontalAlignment: Text.AlignHCenter
color: "#bbb"
}
}
// Кнопка хранилища внизу слева
Button {
id: vaultButton
Layout.fillWidth: true
text: qsTr("▨ Хранилище…")
onClicked: root.openVaultRequested()
}
}
// Меню-«бутерброд» при нажатии «+»
Menu {
id: addMenu
x: addButton.x
y: addButton.y + addButton.height
width: 140
Action {
text: qsTr("Файл")
onTriggered: root.newFileRequested()
}
Action {
text: qsTr("Папка")
onTriggered: root.newFolderRequested()
}
}
}