2025-03-29 08:01:13 -04:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Layouts
|
2025-03-29 09:55:09 -04:00
|
|
|
import QtQuick.Dialogs
|
2025-03-29 08:01:13 -04:00
|
|
|
|
|
|
|
|
import "Menu"
|
|
|
|
|
|
|
|
|
|
ApplicationWindow {
|
2025-03-29 09:55:09 -04:00
|
|
|
id: appWindow
|
|
|
|
|
|
2025-03-29 08:01:13 -04:00
|
|
|
height: 800
|
|
|
|
|
title: "CLIDE"
|
|
|
|
|
visible: true
|
|
|
|
|
width: 1200
|
|
|
|
|
|
|
|
|
|
menuBar: ClideMenuBar {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
anchors.fill: parent
|
2025-03-29 09:55:09 -04:00
|
|
|
color: "#1e1f22"
|
|
|
|
|
}
|
|
|
|
|
MessageDialog {
|
|
|
|
|
id: errorDialog
|
|
|
|
|
|
|
|
|
|
title: qsTr("Error")
|
|
|
|
|
}
|
|
|
|
|
RowLayout {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
|
|
// Customized handle to drag between the Navigation and the Editor.
|
|
|
|
|
handle: Rectangle {
|
|
|
|
|
border.color: SplitHandle.hovered ? "#303234" : "#3c3f41"
|
|
|
|
|
color: SplitHandle.pressed ? "#4b4f51" : "#3c3f41"
|
|
|
|
|
implicitWidth: 8
|
|
|
|
|
opacity: SplitHandle.hovered || navigationView.width < 15 ? 1.0 : 0.0
|
|
|
|
|
|
|
|
|
|
Behavior on opacity {
|
|
|
|
|
OpacityAnimator {
|
|
|
|
|
duration: 1400
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: navigationView
|
|
|
|
|
|
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
|
SplitView.preferredWidth: 250
|
|
|
|
|
color: "#303234"
|
|
|
|
|
|
|
|
|
|
StackLayout {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
|
|
// Shows the help text.
|
|
|
|
|
Text {
|
|
|
|
|
color: "white"
|
|
|
|
|
text: qsTr("File system view placeholder")
|
|
|
|
|
wrapMode: TextArea.Wrap
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: Shows the files on the file system.
|
|
|
|
|
// ClideProjectView {
|
|
|
|
|
// id: fileSystemView
|
|
|
|
|
// color: Colors.surface1
|
|
|
|
|
// onFileClicked: path => root.currentFilePath = path
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
SplitView {
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
|
|
|
|
|
|
// Customized handle to drag between the Navigation and the Editor.
|
|
|
|
|
handle: Rectangle {
|
|
|
|
|
border.color: SplitHandle.hovered ? "#2b2b2b" : "#3c3f41"
|
|
|
|
|
color: SplitHandle.pressed ? "#4b4f51" : "#3c3f41"
|
|
|
|
|
implicitHeight: 8
|
|
|
|
|
opacity: SplitHandle.hovered || navigationView.width < 15 ? 1.0 : 0.0
|
|
|
|
|
|
|
|
|
|
Behavior on opacity {
|
|
|
|
|
OpacityAnimator {
|
|
|
|
|
duration: 1400
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
|
id: areaText
|
|
|
|
|
|
|
|
|
|
color: "#ccced3"
|
|
|
|
|
focus: true
|
|
|
|
|
persistentSelection: true
|
|
|
|
|
selectByMouse: true
|
|
|
|
|
// selectedTextColor: control.palette.highlightedText
|
|
|
|
|
// selectionColor: control.palette.highlight
|
|
|
|
|
textFormat: Qt.AutoText
|
|
|
|
|
wrapMode: TextArea.Wrap
|
|
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
|
color: "#2b2b2b"
|
|
|
|
|
implicitHeight: 650
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onLinkActivated: function (link) {
|
|
|
|
|
Qt.openUrlExternally(link);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: Handle saving
|
|
|
|
|
// Component.onCompleted: {
|
|
|
|
|
// if (Qt.application.arguments.length === 2)
|
|
|
|
|
// textDocument.source = "file:" + Qt.application.arguments[1]
|
|
|
|
|
// else
|
|
|
|
|
// textDocument.source = "qrc:/texteditor.html"
|
|
|
|
|
// }
|
|
|
|
|
// textDocument.onStatusChanged: {
|
|
|
|
|
// // a message lookup table using computed properties:
|
|
|
|
|
// // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer
|
|
|
|
|
// const statusMessages = {
|
|
|
|
|
// [ TextDocument.ReadError ]: qsTr("Failed to load “%1”"),
|
|
|
|
|
// [ TextDocument.WriteError ]: qsTr("Failed to save “%1”"),
|
|
|
|
|
// [ TextDocument.NonLocalFileError ]: qsTr("Not a local file: “%1”"),
|
|
|
|
|
// }
|
|
|
|
|
// const err = statusMessages[textDocument.status]
|
|
|
|
|
// if (err) {
|
|
|
|
|
// errorDialog.text = err.arg(textDocument.source)
|
|
|
|
|
// errorDialog.open()
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
TextArea {
|
|
|
|
|
id: areaConsole
|
|
|
|
|
|
|
|
|
|
bottomPadding: 0
|
|
|
|
|
leftPadding: 6
|
|
|
|
|
persistentSelection: true
|
|
|
|
|
placeholderText: qsTr("Placeholder for bash terminal.")
|
|
|
|
|
placeholderTextColor: "gray"
|
|
|
|
|
readOnly: true
|
|
|
|
|
rightPadding: 6
|
|
|
|
|
selectByMouse: true
|
|
|
|
|
// selectedTextColor: control.palette.highlightedText
|
|
|
|
|
// selectionColor: control.palette.highlight
|
|
|
|
|
textFormat: Qt.AutoText
|
|
|
|
|
topPadding: 6
|
|
|
|
|
wrapMode: TextArea.Wrap
|
|
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
|
color: "#2b2b2b"
|
|
|
|
|
implicitHeight: 20
|
|
|
|
|
// border.color: control.enabled ? "#21be2b" : "transparent"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-03-29 08:01:13 -04:00
|
|
|
}
|
|
|
|
|
}
|