clide/qml/ClideProjectView.qml

56 lines
1.5 KiB
QML
Raw Normal View History

2025-03-29 17:59:17 -04:00
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
2025-03-30 11:20:21 -04:00
import clide.module 1.0
2025-03-29 17:59:17 -04:00
SplitView {
2025-03-30 16:14:58 -04:00
id: root
// Path to the file selected in the tree view.
2025-03-30 21:38:57 -04:00
default property string selectedFilePath: FileSystem.filePath;
2025-03-30 16:14:58 -04:00
2025-03-29 17:59:17 -04:00
Layout.fillHeight: true
Layout.fillWidth: true
anchors.fill: parent
// Customized handle to drag between the Navigation and the Editor.
handle: Rectangle {
id: verticalSplitHandle
2025-03-30 11:20:21 -04:00
border.color: SplitHandle.pressed ? RustColors.pressed : SplitHandle.hovered ? RustColors.hovered : RustColors.gutter
color: SplitHandle.pressed ? RustColors.pressed : SplitHandle.hovered ? RustColors.hovered : RustColors.gutter
2025-03-29 17:59:17 -04:00
implicitWidth: 8
2025-03-30 11:20:21 -04:00
radius: 2.5
2025-03-29 17:59:17 -04:00
2025-03-30 11:20:21 -04:00
// Execute these behaviors when the color is changed.
Behavior on color {
ColorAnimation {
duration: 400
2025-03-29 17:59:17 -04:00
}
}
}
Rectangle {
id: navigationView
color: RustColors.explorer_background
2025-03-29 17:59:17 -04:00
SplitView.fillHeight: true
SplitView.minimumWidth: 0
2025-03-29 17:59:17 -04:00
SplitView.preferredWidth: 200
SplitView.maximumWidth: 250
2025-03-29 17:59:17 -04:00
StackLayout {
anchors.fill: parent
2025-03-30 16:14:58 -04:00
ClideTreeView {
id: clideTreeView
2025-03-30 21:38:57 -04:00
onFileClicked: path => root.selectedFilePath = path
2025-03-30 16:14:58 -04:00
}
2025-03-29 17:59:17 -04:00
}
}
ClideEditor {
SplitView.fillWidth: true
2025-03-30 13:50:23 -04:00
// Initialize using the Default trait in Rust QML singleton FileSystem.
2025-03-30 21:38:57 -04:00
filePath: root.selectedFilePath
2025-03-29 17:59:17 -04:00
}
}