Compare commits
2 Commits
67bf82d0cb
...
c170b3b20d
| Author | SHA1 | Date | |
|---|---|---|---|
| c170b3b20d | |||
| 125041f469 |
1
build.rs
1
build.rs
@@ -7,6 +7,7 @@ fn main() {
|
||||
"qml/ClideTreeView.qml",
|
||||
"qml/ClideProjectView.qml",
|
||||
"qml/ClideEditor.qml",
|
||||
"qml/ClideEditorView.qml",
|
||||
"qml/ClideMenuBar.qml",
|
||||
"qml/ClideLogger.qml",
|
||||
"qml/Components/ClideScrollBar.qml",
|
||||
|
||||
@@ -9,33 +9,6 @@ import QtQuick.Layouts
|
||||
import clide.module 1.0
|
||||
import Logger 1.0
|
||||
|
||||
SplitView {
|
||||
id: root
|
||||
|
||||
// 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
|
||||
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
orientation: Qt.Vertical
|
||||
|
||||
// Customized handle to drag between the Editor and the Console.
|
||||
handle: ClideHandle {
|
||||
pressed: SplitHandle.pressed
|
||||
hovered: SplitHandle.hovered
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
// Show logging is working.
|
||||
Logger.info("Info logs");
|
||||
Logger.warn("Warning logs");
|
||||
Logger.debug("Debug logs");
|
||||
Logger.error("Error logs");
|
||||
Logger.trace("Trace logs");
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
// We use a flickable to synchronize the position of the editor and
|
||||
// the line numbers. This is necessary because the line numbers can
|
||||
@@ -161,8 +134,3 @@ SplitView {
|
||||
}
|
||||
}
|
||||
}
|
||||
ClideLogger {
|
||||
id: areaConsole
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
46
qml/ClideEditorView.qml
Normal file
46
qml/ClideEditorView.qml
Normal file
@@ -0,0 +1,46 @@
|
||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
||||
//
|
||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import clide.module 1.0
|
||||
import Logger 1.0
|
||||
|
||||
SplitView {
|
||||
id: root
|
||||
|
||||
// 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
|
||||
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
orientation: Qt.Vertical
|
||||
|
||||
// Customized handle to drag between the Editor and the Console.
|
||||
handle: ClideHandle {
|
||||
pressed: SplitHandle.pressed
|
||||
hovered: SplitHandle.hovered
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
// Show logging is working.
|
||||
Logger.info("Info logs");
|
||||
Logger.warn("Warning logs");
|
||||
Logger.debug("Debug logs");
|
||||
Logger.error("Error logs");
|
||||
Logger.trace("Trace logs");
|
||||
}
|
||||
|
||||
ClideEditor{
|
||||
id: clideEditor
|
||||
}
|
||||
ClideLogger {
|
||||
id: areaConsole
|
||||
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@ SplitView {
|
||||
}
|
||||
}
|
||||
}
|
||||
ClideEditor {
|
||||
ClideEditorView {
|
||||
id: clideEditor
|
||||
|
||||
SplitView.fillWidth: true
|
||||
|
||||
@@ -57,9 +57,7 @@ TreeView {
|
||||
indentation: 12
|
||||
|
||||
background: Rectangle {
|
||||
// TODO: Fix flickering from color transition on states here.
|
||||
color: (treeDelegate.index === fileSystemTreeView.lastIndex) ? RustColors.explorer_text_selected : (hoverHandler.hovered ? RustColors.explorer_hovered : "transparent")
|
||||
opacity: hoverHandler.hovered ? 0.75 : 1.0
|
||||
color: "transparent"
|
||||
radius: 2.5
|
||||
|
||||
Behavior on color {
|
||||
@@ -128,6 +126,7 @@ TreeView {
|
||||
switch (button) {
|
||||
case Qt.LeftButton:
|
||||
fileSystemTreeView.toggleExpanded(treeDelegate.row);
|
||||
fileSystemTreeView.lastIndex = treeDelegate.index
|
||||
// If this model item doesn't have children, it means it's
|
||||
// representing a file.
|
||||
if (!treeDelegate.hasChildren)
|
||||
|
||||
Reference in New Issue
Block a user