Skip to content

Commit

Permalink
chore: move the example app into its own crate (#67)
Browse files Browse the repository at this point in the history
This allows us to use the latest egui version for the example and
provide a directory that people can use as a starter app.
  • Loading branch information
Stonks3141 authored Oct 11, 2024
1 parent 51d19c7 commit 336e468
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[workspace]
members = ["examples/todo"]

[package]
name = "catppuccin-egui"
version = "5.3.0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ To use a theme, call the `set_theme` function with a theme and the egui context:
catppuccin_egui::set_theme(&ctx, catppuccin_egui::MOCHA);
```

To run the example app, run `cargo run --example todo`.
To run the example app, run `cargo run -p todo`.

See the full documentation at https://docs.rs/catppuccin-egui.

Expand Down
10 changes: 10 additions & 0 deletions examples/todo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "todo"
version = "0.1.0"
edition = "2021"
license = "MIT"
publish = false

[dependencies]
eframe = "0.29"
catppuccin-egui = { version = "5.3", default-features = false, features = ["egui29"] }
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/todo.rs → examples/todo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use eframe::egui;
fn main() {
let native_options = eframe::NativeOptions::default();
let app = App::default();
if let Err(e) = eframe::run_native("todos", native_options, Box::new(|_| Box::new(app))) {
if let Err(e) = eframe::run_native("todos", native_options, Box::new(|_| Ok(Box::new(app)))) {
eprintln!("{e}");
std::process::exit(1);
}
Expand Down

0 comments on commit 336e468

Please sign in to comment.