-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.rs
More file actions
43 lines (38 loc) · 1.12 KB
/
Copy pathmod.rs
File metadata and controls
43 lines (38 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: 2025 Alexander Minges
//! Application entry point wiring egui/eframe to launch the ELNPack UI.
use crate::ui::ElnPackApp;
use eframe::egui;
use egui_phosphor::Variant;
/// Bootstrap the desktop application and run the main egui event loop.
///
/// # Errors
///
/// Propagates any failure from `eframe::run_native`, such as window creation errors.
///
/// # Examples
///
/// ```rust,ignore
/// fn main() -> eframe::Result<()> {
/// elnpack::app::run()
/// }
/// ```
pub fn run() -> eframe::Result<()> {
// Register Phosphor icon font.
let mut fonts = egui::FontDefinitions::default();
egui_phosphor::add_to_fonts(&mut fonts, Variant::Regular);
let options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default()
.with_inner_size([1024.0, 768.0])
.with_min_inner_size([600.0, 400.0]),
..Default::default()
};
eframe::run_native(
"ELNPack",
options,
Box::new(|cc| {
cc.egui_ctx.set_fonts(fonts);
Ok(Box::new(ElnPackApp::default()))
}),
)
}