Initial project scaffold: Rust egui ePub reader
- Cargo.toml with eframe, egui, epub, rfd, serde dependencies - Source modules: app, book, font, persistence, reader, theme - MinGW static linking config - .gitignore for build artifacts
This commit is contained in:
2
.cargo/config.toml
Normal file
2
.cargo/config.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[target.x86_64-pc-windows-gnu]
|
||||
rustflags = ["-C", "target-feature=+crt-static"]
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/target/
|
||||
4609
Cargo.lock
generated
Normal file
4609
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
23
Cargo.toml
Normal file
23
Cargo.toml
Normal file
@@ -0,0 +1,23 @@
|
||||
[package]
|
||||
name = "epub-read"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
description = "ePub reader with egui"
|
||||
|
||||
[[bin]]
|
||||
name = "epub-read"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
eframe = "0.31"
|
||||
egui = "0.31"
|
||||
epub = "1.2"
|
||||
rfd = "0.15"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
|
||||
[profile.release]
|
||||
opt-level = "z"
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
strip = "symbols"
|
||||
11
src/app.rs
Normal file
11
src/app.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
pub struct App;
|
||||
|
||||
impl App {
|
||||
pub fn new(_cc: &eframe::CreationContext) -> Self {
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
||||
impl eframe::App for App {
|
||||
fn update(&mut self, _ctx: &egui::Context, _frame: &mut eframe::Frame) {}
|
||||
}
|
||||
0
src/book.rs
Normal file
0
src/book.rs
Normal file
1
src/font.rs
Normal file
1
src/font.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub fn setup_fonts(_ctx: &egui::Context) {}
|
||||
25
src/main.rs
Normal file
25
src/main.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
#![windows_subsystem = "windows"]
|
||||
|
||||
mod app;
|
||||
mod book;
|
||||
mod font;
|
||||
mod persistence;
|
||||
mod reader;
|
||||
mod theme;
|
||||
|
||||
fn main() -> eframe::Result {
|
||||
let native_options = eframe::NativeOptions {
|
||||
viewport: eframe::egui::ViewportBuilder::default()
|
||||
.with_inner_size([900.0, 700.0])
|
||||
.with_min_inner_size([600.0, 400.0]),
|
||||
..Default::default()
|
||||
};
|
||||
eframe::run_native(
|
||||
"ePub Reader",
|
||||
native_options,
|
||||
Box::new(|cc| {
|
||||
font::setup_fonts(&cc.egui_ctx);
|
||||
Ok(Box::new(app::App::new(cc)))
|
||||
}),
|
||||
)
|
||||
}
|
||||
0
src/persistence.rs
Normal file
0
src/persistence.rs
Normal file
0
src/reader.rs
Normal file
0
src/reader.rs
Normal file
0
src/theme.rs
Normal file
0
src/theme.rs
Normal file
Reference in New Issue
Block a user