Use app_creation for common app setup functions

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2024-04-01 11:04:49 -04:00
committed by William Casarin
parent a927c56870
commit 80b76c5381
4 changed files with 32 additions and 16 deletions

View File

@@ -1,6 +1,8 @@
#![warn(clippy::all, rust_2018_idioms)]
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
use notedeck::Damus;
use notedeck::app_creation::generate_native_options;
// Entry point for wasm
//#[cfg(target_arch = "wasm32")]
@@ -13,17 +15,9 @@ async fn main() {
// Log to stdout (if you run with `RUST_LOG=debug`).
tracing_subscriber::fmt::init();
let window_builder = Box::new(|builder: egui::ViewportBuilder| {
builder.with_fullsize_content_view(true)
.with_titlebar_shown(false)
.with_title_shown(false)
});
let mut native_options = eframe::NativeOptions::default();
native_options.window_builder = Some(window_builder);
let _res = eframe::run_native(
"Damus NoteDeck",
native_options,
generate_native_options(),
Box::new(|cc| Box::new(Damus::new(cc, ".", std::env::args().collect()))),
);
}