feat: project 3
This commit is contained in:
parent
8f4463782c
commit
b9a362d490
15 changed files with 5425 additions and 15 deletions
28
project3/src/main.rs
Normal file
28
project3/src/main.rs
Normal 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())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue