Skip to content

Commit

Permalink
add catppuccin_egui themes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vulae committed Aug 4, 2024
1 parent e4eb86a commit 6cc2d5a
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 11 deletions.
157 changes: 146 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ edition = "2021"
[dependencies]
anyhow = "1.0.86"
bitflags = "2.6.0"
catppuccin-egui = { version = "5.2.0", default-features = false, features = ["egui28"] }
clap = { version = "4.5.11", features = ["derive"] }
dark-light = "1.1.1"
eframe = "0.28.1"
egui = "0.28.1"
env_logger = { version = "0.11.5", features = ["auto-color", "humantime"] }
Expand Down
8 changes: 8 additions & 0 deletions src/app/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ impl SharedAppContext {

impl eframe::App for SharedAppContext {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {

// TODO: Add config.toml with theme selection. (& with custom theme with catppuccin_egui::Theme)
catppuccin_egui::set_theme(ctx, match dark_light::detect() {
dark_light::Mode::Dark => catppuccin_egui::MOCHA,
dark_light::Mode::Light => catppuccin_egui::LATTE,
dark_light::Mode::Default => catppuccin_egui::MOCHA,
});

self.app_context.borrow_mut().auto_focus_new_explorers = !ctx.input(|i| i.modifiers.shift);

let files = ctx.input(|i| i.raw.dropped_files.clone());
Expand Down

0 comments on commit 6cc2d5a

Please sign in to comment.