TUI #1

Merged
shaunrd0 merged 73 commits from ui into master 2026-01-25 20:57:37 +00:00
3 changed files with 14 additions and 8 deletions
Showing only changes of commit d2846e1e4e - Show all commits

View File

@ -1,10 +1,10 @@
use anyhow::Result;
use cxx_qt_lib::QString;
use std::error::Error;
pub mod colors;
pub mod filesystem;
pub fn run(root_path: std::path::PathBuf) -> Result<(), Box<dyn Error>> {
pub fn run(root_path: std::path::PathBuf) -> Result<()> {
println!("Starting the GUI editor at {:?}", root_path);
use cxx_qt_lib::{QGuiApplication, QQmlApplicationEngine, QUrl};

View File

@ -1,6 +1,4 @@
// TODO: Header
use std::error::Error;
use anyhow::Result;
use std::process::{Command, Stdio};
use structopt::StructOpt;
@ -25,7 +23,7 @@ struct Cli {
pub gui: bool,
}
fn main() -> Result<(), Box<dyn Error>> {
fn main() -> Result<()> {
let args = Cli::from_args();
let root_path = match args.path {

View File

@ -65,8 +65,16 @@ impl<'a> App<'a> {
}
fn draw_tabs(&self, area: Rect, buf: &mut Buffer) {
// TODO: Tabs should be opened from file explorer
Tabs::new(["file.md", "file.cpp"])
// Determine the tab title from the current file (or use a fallback).
let title = self
.editor
.file_path
.as_ref()
.and_then(|p| p.file_name())
.and_then(|s| s.to_str())
.unwrap_or("Untitled");
Tabs::new(vec![title])
.divider(symbols::DOT)
.block(
Block::default()