660694f00f
- Updated styles in `styles.rs` to include new pane and canvas backgrounds, while marking unused functions with `#[allow(dead_code)]`. - Modified `text_editor.rs` to suppress warnings for unused function parameters. - Enhanced `title_bar.rs` to create a unified title/menu bar with improved hover states and draggable functionality. - Simplified `sidebar.rs` to always use a single-column layout and improved tool button styling with hover feedback. - Added a new `viewport.rs` file to implement a custom canvas viewport widget for zoom and pan rendering, replacing the previous layout-based approach. - Updated theme management in `theme.rs` to suppress warnings for unused methods. - Adjusted line count report to reflect recent changes in codebase.
69 lines
2.0 KiB
Rust
69 lines
2.0 KiB
Rust
//! HCIE Iced GUI — entry point.
|
|
//!
|
|
//! Launches the Iced application with the HCIE image editor.
|
|
|
|
mod app;
|
|
mod canvas;
|
|
mod color_picker;
|
|
mod dialogs;
|
|
mod dock;
|
|
mod io;
|
|
mod panels;
|
|
mod sidebar;
|
|
mod theme;
|
|
|
|
use app::HcieIcedApp;
|
|
|
|
fn main() {
|
|
let _ = env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info"))
|
|
.try_init();
|
|
|
|
log::info!("Starting HCIE Iced GUI");
|
|
|
|
let args: Vec<String> = std::env::args().collect();
|
|
let mut load_path: Option<std::path::PathBuf> = None;
|
|
|
|
let mut i = 1;
|
|
while i < args.len() {
|
|
match args[i].as_str() {
|
|
"--help" | "-h" => {
|
|
println!("Usage: hcie-iced [OPTIONS] [FILE]");
|
|
println!();
|
|
println!("HCIE — Iced Edition");
|
|
println!();
|
|
println!("Options:");
|
|
println!(" -h, --help Print this help message");
|
|
println!();
|
|
println!("Arguments:");
|
|
println!(" FILE Image file to open on startup");
|
|
std::process::exit(0);
|
|
}
|
|
other if !other.starts_with('-') => {
|
|
load_path = Some(std::path::PathBuf::from(other));
|
|
}
|
|
unknown => {
|
|
eprintln!("Unknown argument: {}", unknown);
|
|
std::process::exit(1);
|
|
}
|
|
}
|
|
i += 1;
|
|
}
|
|
|
|
// Start tablet evdev listener
|
|
let tablet_state = std::sync::Arc::new(std::sync::Mutex::new(
|
|
io::tablet::TabletState::new(),
|
|
));
|
|
io::tablet::start_evdev_listener(tablet_state.clone());
|
|
|
|
let _ = iced::application("HCIE — Iced Edition", HcieIcedApp::update, HcieIcedApp::view)
|
|
.subscription(HcieIcedApp::subscription)
|
|
.theme(HcieIcedApp::theme)
|
|
.window_size((1280.0, 800.0))
|
|
.decorations(false)
|
|
.run_with(move || {
|
|
let (mut app, init_task) = HcieIcedApp::new(load_path);
|
|
app.tablet_state = tablet_state;
|
|
(app, init_task)
|
|
});
|
|
}
|