Format with qmlformat.

This commit is contained in:
2026-02-02 18:08:37 -05:00
parent 5af09485a3
commit 29024e3999
8 changed files with 280 additions and 273 deletions

View File

@@ -22,6 +22,7 @@ SplitView {
// Customized handle to drag between the Navigation and the Editor.
handle: Rectangle {
id: verticalSplitHandle
border.color: SplitHandle.pressed ? RustColors.pressed : SplitHandle.hovered ? RustColors.hovered : RustColors.gutter
color: SplitHandle.pressed ? RustColors.pressed : SplitHandle.hovered ? RustColors.hovered : RustColors.gutter
implicitWidth: 8
@@ -37,65 +38,71 @@ SplitView {
Rectangle {
id: navigationView
color: RustColors.explorer_background
SplitView.fillHeight: true
SplitView.maximumWidth: 250
SplitView.minimumWidth: 0
SplitView.preferredWidth: 200
SplitView.maximumWidth: 250
color: RustColors.explorer_background
ColumnLayout {
spacing: 2
// TODO: Make a ClideBreadCrumb element to support select parent paths as root
Rectangle {
width: navigationView.width
height: 25
color: RustColors.explorer_background
height: 25
width: navigationView.width
Text {
id: breadCrumb
anchors.fill: parent
text: clideTreeView.rootDirectory
color: RustColors.explorer_text
elide: Text.ElideLeft
horizontalAlignment: Text.AlignHCenter
text: clideTreeView.rootDirectory
verticalAlignment: Text.AlignVCenter
}
TapHandler {
acceptedButtons: Qt.RightButton
onSingleTapped: (eventPoint, button) => contextMenu.popup()
}
Menu {
id: contextMenu
Action {
text: qsTr("Reset root index")
onTriggered: {
Logger.log("Resetting root directory: " + clideTreeView.originalRootDirectory)
clideTreeView.rootDirectory = clideTreeView.originalRootDirectory
Logger.log("Resetting root directory: " + clideTreeView.originalRootDirectory);
clideTreeView.rootDirectory = clideTreeView.originalRootDirectory;
}
}
}
}
ClideTreeView {
id: clideTreeView
onFileClicked: path => clideEditor.filePath = path
width: navigationView.width
height: navigationView.height
// Path to the directory opened in the file explorer.
originalRootDirectory: root.projectDir
rootDirectory: root.projectDir
width: navigationView.width
onFileClicked: path => clideEditor.filePath = path
onRootDirectoryChanged: {
Logger.log("Setting root directory: " + clideTreeView.rootDirectory)
breadCrumb.text = clideTreeView.rootDirectory
Logger.log("Setting root directory: " + clideTreeView.rootDirectory);
breadCrumb.text = clideTreeView.rootDirectory;
}
}
}
}
ClideEditor {
id: clideEditor
SplitView.fillWidth: true
// Provide a path to the file currently open in the text editor.