Add FileSystem Rust module.

This commit is contained in:
2025-03-30 13:50:23 -04:00
parent 4f3aebe64f
commit 1546eb1028
3 changed files with 62 additions and 0 deletions

View File

@@ -5,10 +5,16 @@ import QtQuick.Layouts
import clide.module 1.0
SplitView {
id: root
Layout.fillHeight: true
Layout.fillWidth: true
orientation: Qt.Vertical
// The path to the file to show in the text editor.
// This is updated by a signal caught within ClideProjectView.
// Initialized by the Default trait for the Rust QML singleton FileSystem.
required property string filePath;
// Customized handle to drag between the Editor and the Console.
handle: Rectangle {
border.color: SplitHandle.pressed ? RustColors.pressed : SplitHandle.hovered ? RustColors.hovered : RustColors.gutter
@@ -102,6 +108,7 @@ SplitView {
// selectionColor: RustColors.editor_highlight
textFormat: Qt.AutoText
wrapMode: TextArea.Wrap
text: FileSystem.readFile(root.filePath)
background: Rectangle {
color: RustColors.editor_background

View File

@@ -51,5 +51,7 @@ SplitView {
}
}
ClideEditor {
// Initialize using the Default trait in Rust QML singleton FileSystem.
filePath: FileSystem.filePath
}
}