Compare commits
9 Commits
0fac2b71ab
...
app-contex
| Author | SHA1 | Date | |
|---|---|---|---|
| 7306e09181 | |||
| 99ad6be5f2 | |||
| ec5a369b84 | |||
| c2c66ab7c0 | |||
| b607a6daaa | |||
| dc778dd859 | |||
| c30b64525b | |||
| a75dad7985 | |||
| a431d02a0e |
17
README.md
17
README.md
@@ -19,22 +19,6 @@ And of course, [Rust](https://www.rust-lang.org/tools/install).
|
|||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||||
```
|
```
|
||||||
|
|
||||||
This project requires at least Qt 6.7. To check your Qt version
|
|
||||||
|
|
||||||
```bash
|
|
||||||
qmake6 -query QT_VERSION
|
|
||||||
```
|
|
||||||
|
|
||||||
Use the [Qt Installer](https://www.qt.io/development/download) to download and install the Qt version of your choice.
|
|
||||||
|
|
||||||
**You must set the QMAKE variable before building clide**. This should be a path to `qmake6` binary installed on your system.
|
|
||||||
The following export is the default installation path for Qt 6.7 on Ubuntu 24.04
|
|
||||||
|
|
||||||
```bash
|
|
||||||
export QMAKE=$HOME/Qt/6.7.3/gcc_64/bin/qmake6
|
|
||||||
export LD_LIBRARY_PATH=$HOME/Qt/6.7.3/gcc_64/lib
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
To install and run clide
|
To install and run clide
|
||||||
@@ -142,7 +126,6 @@ Some helpful links for reading up on QML if you're just getting started.
|
|||||||
* [All QML Controls Types](https://doc.qt.io/qt-6/qtquick-controls-qmlmodule.html)
|
* [All QML Controls Types](https://doc.qt.io/qt-6/qtquick-controls-qmlmodule.html)
|
||||||
* [KDAB CXX-Qt Book](https://kdab.github.io/cxx-qt/book/)
|
* [KDAB CXX-Qt Book](https://kdab.github.io/cxx-qt/book/)
|
||||||
* [github.com/KDAB/cxx-qt](https://github.com/KDAB/cxx-qt)
|
* [github.com/KDAB/cxx-qt](https://github.com/KDAB/cxx-qt)
|
||||||
* [QML and C++ Intergration](https://doc.qt.io/qt-6/qtqml-cppintegration-overview.html)
|
|
||||||
|
|
||||||
|
|
||||||
### Plugins
|
### Plugins
|
||||||
|
|||||||
1
build.rs
1
build.rs
@@ -18,7 +18,6 @@ fn main() {
|
|||||||
.qt_module("Gui")
|
.qt_module("Gui")
|
||||||
.qt_module("Svg")
|
.qt_module("Svg")
|
||||||
.qt_module("Xml")
|
.qt_module("Xml")
|
||||||
.qrc("./resources.qrc")
|
|
||||||
.files(["src/gui/colors.rs", "src/gui/filesystem.rs"])
|
.files(["src/gui/colors.rs", "src/gui/filesystem.rs"])
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
@@ -1,6 +1,4 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
// TODO: Header
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls.Basic
|
import QtQuick.Controls.Basic
|
||||||
@@ -31,7 +29,7 @@ ApplicationWindow {
|
|||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.margins: 20
|
anchors.margins: 20
|
||||||
|
|
||||||
source: "qrc:/images/kilroy.png"
|
source: "../icons/kilroy-256.png"
|
||||||
sourceSize.width: 80
|
sourceSize.width: 80
|
||||||
sourceSize.height: 80
|
sourceSize.height: 80
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
@@ -43,26 +39,11 @@ SplitView {
|
|||||||
SplitView.preferredWidth: 200
|
SplitView.preferredWidth: 200
|
||||||
SplitView.maximumWidth: 250
|
SplitView.maximumWidth: 250
|
||||||
|
|
||||||
ColumnLayout {
|
StackLayout {
|
||||||
spacing: 2
|
anchors.fill: parent
|
||||||
Rectangle {
|
|
||||||
width: navigationView.width
|
|
||||||
height: breadCrumb.height + 5
|
|
||||||
|
|
||||||
color: RustColors.explorer_text
|
|
||||||
Text {
|
|
||||||
id: breadCrumb
|
|
||||||
text: clideTreeView.rootDirectory
|
|
||||||
elide: Text.ElideLeft
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ClideTreeView {
|
ClideTreeView {
|
||||||
id: clideTreeView
|
id: clideTreeView
|
||||||
onFileClicked: path => root.projectDir = path
|
onFileClicked: path => root.projectDir = path
|
||||||
width: navigationView.width
|
|
||||||
height: navigationView.height
|
|
||||||
|
|
||||||
// Path to the directory opened in the file explorer.
|
// Path to the directory opened in the file explorer.
|
||||||
rootDirectory: root.projectDir
|
rootDirectory: root.projectDir
|
||||||
|
|||||||
@@ -1,38 +1,38 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Effects
|
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
|
||||||
import clide.module 1.0
|
import clide.module 1.0
|
||||||
|
|
||||||
TreeView {
|
Rectangle {
|
||||||
id: fileSystemTreeView
|
id: root
|
||||||
model: FileSystem
|
color: RustColors.explorer_background
|
||||||
|
|
||||||
property int lastIndex: -1
|
|
||||||
|
|
||||||
required property string rootDirectory
|
required property string rootDirectory
|
||||||
|
|
||||||
signal fileClicked(string filePath)
|
signal fileClicked(string filePath)
|
||||||
|
|
||||||
|
TreeView {
|
||||||
|
id: fileSystemTreeView
|
||||||
|
anchors.margins: 15
|
||||||
|
|
||||||
rootIndex: FileSystem.rootIndex
|
property int lastIndex: -1
|
||||||
leftMargin: 5
|
|
||||||
|
model: FileSystem
|
||||||
|
anchors.fill: parent
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
boundsMovement: Flickable.StopAtBounds
|
boundsMovement: Flickable.StopAtBounds
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
FileSystem.rootIndex = FileSystem.setDirectory(fileSystemTreeView.rootDirectory)
|
FileSystem.setDirectory(root.rootDirectory)
|
||||||
|
fileSystemTreeView.expandRecursively(0, -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// The delegate represents a single entry in the filesystem.
|
// The delegate represents a single entry in the filesystem.
|
||||||
delegate: TreeViewDelegate {
|
delegate: TreeViewDelegate {
|
||||||
id: treeDelegate
|
id: treeDelegate
|
||||||
indentation: 6
|
indentation: 8
|
||||||
implicitWidth: fileSystemTreeView.width > 0 ? fileSystemTreeView.width : 250
|
implicitWidth: fileSystemTreeView.width > 0 ? fileSystemTreeView.width : 250
|
||||||
implicitHeight: 25
|
implicitHeight: 25
|
||||||
|
|
||||||
@@ -88,29 +88,8 @@ TreeView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MultiEffect {
|
|
||||||
id: iconOverlay
|
|
||||||
|
|
||||||
anchors.fill: directoryIcon
|
|
||||||
source: directoryIcon
|
|
||||||
colorization: 1.0
|
|
||||||
brightness: 1.0
|
|
||||||
colorizationColor: {
|
|
||||||
const isFile = !treeDelegate.hasChildren;
|
|
||||||
if (isFile)
|
|
||||||
return Qt.lighter(RustColors.explorer_folder, 2)
|
|
||||||
|
|
||||||
const isExpandedFolder = treeDelegate.expanded && treeDelegate.hasChildren;
|
|
||||||
if (isExpandedFolder)
|
|
||||||
return Qt.darker(RustColors.explorer_folder, 2)
|
|
||||||
else
|
|
||||||
return RustColors.explorer_folder
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
HoverHandler {
|
HoverHandler {
|
||||||
id: hoverHandler
|
id: hoverHandler
|
||||||
acceptedDevices: PointerDevice.Mouse
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
@@ -139,14 +118,13 @@ TreeView {
|
|||||||
text: qsTr("Set as root index")
|
text: qsTr("Set as root index")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
console.log("Setting directory: " + treeDelegate.filePath)
|
console.log("Setting directory: " + treeDelegate.filePath)
|
||||||
FileSystem.rootIndex = FileSystem.setDirectory(treeDelegate.filePath)
|
FileSystem.setDirectory(treeDelegate.filePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Action {
|
Action {
|
||||||
text: qsTr("Reset root index")
|
text: qsTr("Reset root index")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
console.log("Reset root index")
|
FileSystem.setDirectory("")
|
||||||
FileSystem.rootIndex = FileSystem.setDirectory(fileSystemTreeView.rootDirectory)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -171,4 +149,5 @@ TreeView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
<RCC>
|
|
||||||
<qresource prefix="/images">
|
|
||||||
<file alias="kilroy.png">images/kilroy-256.png</file>
|
|
||||||
</qresource>
|
|
||||||
</RCC>
|
|
||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
use crate::AppContext;
|
use crate::AppContext;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use cxx_qt_lib::{QMapPair, QMapPair_QString_QVariant, QString, QVariant};
|
use cxx_qt_lib::{QMapPair, QMapPair_QString_QVariant, QString, QVariant};
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
#[cxx_qt::bridge]
|
#[cxx_qt::bridge]
|
||||||
|
|
||||||
pub mod qobject {
|
pub mod qobject {
|
||||||
unsafe extern "C++" {
|
unsafe extern "C++" {
|
||||||
include!("cxx-qt-lib/qcolor.h");
|
include!("cxx-qt-lib/qcolor.h");
|
||||||
@@ -88,10 +83,10 @@ impl Default for RustColorsImpl {
|
|||||||
gutter: QColor::try_from("#1e1f22").unwrap(),
|
gutter: QColor::try_from("#1e1f22").unwrap(),
|
||||||
explorer_hovered: QColor::try_from("#4c5053").unwrap(),
|
explorer_hovered: QColor::try_from("#4c5053").unwrap(),
|
||||||
explorer_text: QColor::try_from("#3b3b3b").unwrap(),
|
explorer_text: QColor::try_from("#3b3b3b").unwrap(),
|
||||||
explorer_text_selected: QColor::try_from("#262626").unwrap(),
|
explorer_text_selected: QColor::try_from("#8b8b8b").unwrap(),
|
||||||
explorer_background: QColor::try_from("#1E1F22").unwrap(),
|
explorer_background: QColor::try_from("#676c70").unwrap(),
|
||||||
explorer_folder: QColor::try_from("#54585b").unwrap(),
|
explorer_folder: QColor::try_from("#54585b").unwrap(),
|
||||||
explorer_folder_open: QColor::try_from("#2b2b2b").unwrap(),
|
explorer_folder_open: QColor::try_from("#FFF").unwrap(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
#[cxx_qt::bridge]
|
#[cxx_qt::bridge]
|
||||||
pub mod qobject {
|
pub mod qobject {
|
||||||
unsafe extern "C++" {
|
unsafe extern "C++" {
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
use anyhow::{Context, Result, anyhow};
|
use anyhow::{Context, Result, anyhow};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use log::{info, trace};
|
use log::{info, trace};
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
mod about;
|
mod about;
|
||||||
mod app;
|
mod app;
|
||||||
mod component;
|
mod component;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
use ratatui::buffer::Buffer;
|
use ratatui::buffer::Buffer;
|
||||||
use ratatui::layout::{Constraint, Direction, Layout, Rect};
|
use ratatui::layout::{Constraint, Direction, Layout, Rect};
|
||||||
use ratatui::text::{Line, Span};
|
use ratatui::text::{Line, Span};
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
use crate::tui::about::About;
|
use crate::tui::about::About;
|
||||||
use crate::tui::app::AppComponent::{AppEditor, AppExplorer, AppLogger};
|
use crate::tui::app::AppComponent::{AppEditor, AppExplorer, AppLogger};
|
||||||
use crate::tui::component::{Action, Component, Focus, FocusState, Visibility, VisibleState};
|
use crate::tui::component::{Action, Component, Focus, FocusState, Visibility, VisibleState};
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
#![allow(dead_code, unused_variables)]
|
#![allow(dead_code, unused_variables)]
|
||||||
|
|
||||||
use crate::tui::component::Focus::Inactive;
|
use crate::tui::component::Focus::Inactive;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
use crate::tui::component::{Action, Component, ComponentState, Focus, FocusState};
|
use crate::tui::component::{Action, Component, ComponentState, Focus, FocusState};
|
||||||
use anyhow::{Context, Result, bail};
|
use anyhow::{Context, Result, bail};
|
||||||
use edtui::{
|
use edtui::{
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
use crate::tui::component::{Action, Component, Focus, FocusState};
|
use crate::tui::component::{Action, Component, Focus, FocusState};
|
||||||
use crate::tui::editor::Editor;
|
use crate::tui::editor::Editor;
|
||||||
use anyhow::{Context, Result, anyhow};
|
use anyhow::{Context, Result, anyhow};
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
use crate::tui::component::{Action, Component, ComponentState, Focus, FocusState};
|
use crate::tui::component::{Action, Component, ComponentState, Focus, FocusState};
|
||||||
use anyhow::{Context, Result, bail};
|
use anyhow::{Context, Result, bail};
|
||||||
use log::trace;
|
use log::trace;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
use crate::tui::component::{Action, Component, ComponentState, Focus, FocusState};
|
use crate::tui::component::{Action, Component, ComponentState, Focus, FocusState};
|
||||||
use log::{LevelFilter, trace};
|
use log::{LevelFilter, trace};
|
||||||
use ratatui::buffer::Buffer;
|
use ratatui::buffer::Buffer;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: GNU General Public License v3.0 or later
|
|
||||||
|
|
||||||
use crate::tui::component::{Action, Component, ComponentState, FocusState};
|
use crate::tui::component::{Action, Component, ComponentState, FocusState};
|
||||||
use crate::tui::menu_bar::MenuBarItemOption::{
|
use crate::tui::menu_bar::MenuBarItemOption::{
|
||||||
About, CloseTab, Exit, Reload, Save, ShowHideExplorer, ShowHideLogger,
|
About, CloseTab, Exit, Reload, Save, ShowHideExplorer, ShowHideLogger,
|
||||||
|
|||||||
Reference in New Issue
Block a user