Add basic TUI support (#1)

This commit was merged in pull request #1.
This commit is contained in:
2026-01-25 20:57:36 +00:00
parent 59acdc48fa
commit 00f9075d0f
29 changed files with 5050 additions and 278 deletions

28
src/gui.rs Normal file
View File

@@ -0,0 +1,28 @@
use anyhow::Result;
use cxx_qt_lib::QString;
use log::trace;
pub mod colors;
pub mod filesystem;
pub fn run(root_path: std::path::PathBuf) -> Result<()> {
trace!(target:"gui::run()", "Starting the GUI editor at {root_path:?}");
use cxx_qt_lib::{QGuiApplication, QQmlApplicationEngine, QUrl};
let mut app = QGuiApplication::new();
let mut engine = QQmlApplicationEngine::new();
if let Some(engine) = engine.as_mut() {
engine.add_import_path(&QString::from("qml/"));
}
if let Some(engine) = engine.as_mut() {
engine.load(&QUrl::from("qml/main.qml"));
}
if let Some(app) = app.as_mut() {
app.exec();
}
Ok(())
}