ced/src/main.rs

35 lines
885 B
Rust
Raw Normal View History

2025-07-05 14:42:45 -04:00
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use eframe::egui;
use std::env;
use std::io::IsTerminal;
2025-07-05 14:42:45 -04:00
mod app;
mod io;
mod ui;
2025-07-23 13:17:10 -04:00
use app::{config::Config, TextEditor};
2025-07-05 14:42:45 -04:00
fn main() -> eframe::Result {
let _args: Vec<String> = env::args().collect();
if std::io::stdin().is_terminal() {
println!("This is a GUI application, are you sure you want to launch from terminal?");
// return Ok(());
}
2025-07-05 14:42:45 -04:00
let options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default()
.with_min_inner_size([600.0, 400.0])
2025-07-15 00:42:01 -04:00
.with_title("ced")
.with_app_id("io.lampnet.ced"),
2025-07-05 14:42:45 -04:00
..Default::default()
};
let config = Config::load();
eframe::run_native(
2025-07-15 00:42:01 -04:00
"ced",
2025-07-05 14:42:45 -04:00
options,
Box::new(move |cc| Ok(Box::new(TextEditor::from_config_with_context(config, cc)))),
)
}