feat: project 3

This commit is contained in:
Kiana Sheibani 2025-12-04 17:37:19 -05:00
parent 8f4463782c
commit b9a362d490
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
15 changed files with 5425 additions and 15 deletions

28
project3/src/main.rs Normal file
View file

@ -0,0 +1,28 @@
#![feature(iterator_try_collect)]
use std::path::{PathBuf, MAIN_SEPARATOR_STR};
use winit::error::EventLoopError;
use xilem::{EventLoop, WindowOptions, Xilem};
mod app;
mod files;
use app::*;
fn main() -> Result<(), EventLoopError> {
// Get start directory, first available of:
// - Current directory
// - Home directory
// - Filesystem root
let start_dir = std::env::current_dir()
.ok()
.or_else(|| std::env::home_dir())
.unwrap_or_else(|| PathBuf::from(MAIN_SEPARATOR_STR));
// Start GUI app
let app = Xilem::new_simple(
AppState::new(start_dir),
app_main,
WindowOptions::new("File Manager"),
);
app.run_in(EventLoop::with_user_event())
}