TUI #1
@ -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};
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user