Skip to content

feat: add egui 0.34 support - #102

Open
Lynnesbian wants to merge 2 commits into
catppuccin:mainfrom
Lynnesbian:main
Open

feat: add egui 0.34 support#102
Lynnesbian wants to merge 2 commits into
catppuccin:mainfrom
Lynnesbian:main

Conversation

@Lynnesbian

Copy link
Copy Markdown

This PR is very similar to #96. I tested it by modifying the todo example, but didn't commit those changes for the same reason @philpax didn't last time.

diff --git i/examples/todo/Cargo.toml w/examples/todo/Cargo.toml
index d760563..aa657d8 100644
--- i/examples/todo/Cargo.toml
+++ w/examples/todo/Cargo.toml
@@ -6,5 +6,5 @@ license = "MIT"
 publish = false
 
 [dependencies]
-eframe = "0.32"
-catppuccin-egui = { version = "5.6", default-features = false, features = ["egui32"] }
+eframe = "0.34"
+catppuccin-egui = { path = "../..", default-features = false, features = ["egui34"] }
diff --git i/examples/todo/src/main.rs w/examples/todo/src/main.rs
index 741dd7b..b2da31d 100644
--- i/examples/todo/src/main.rs
+++ w/examples/todo/src/main.rs
@@ -4,6 +4,7 @@
 
 use catppuccin_egui::{FRAPPE, LATTE, MACCHIATO, MOCHA};
 use eframe::egui;
+use eframe::egui::Ui;
 
 fn main() {
     let native_options = eframe::NativeOptions::default();
@@ -92,7 +93,7 @@ impl Default for App {
 }
 
 impl eframe::App for App {
-    fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
+    fn ui(&mut self, ctx: &mut Ui, _frame: &mut eframe::Frame) {
         catppuccin_egui::set_theme(
             ctx,
             match self.theme {

I've also updated lib.rs to avoid a deprecation warning on Context::style:

diff --git c/src/lib.rs w/src/lib.rs
index be38f38..3fc7816 100644
--- c/src/lib.rs
+++ w/src/lib.rs
@@ -69,7 +69,12 @@ pub use themes::*;
 
 /// Apply the given theme to a [`Context`](egui::Context).
 pub fn set_theme(ctx: &egui::Context, theme: Theme) {
+    #[cfg(feature = "egui34")]
+    let old = ctx.global_style().visuals.clone();
+
+    #[cfg(not(feature = "egui34"))]
     let old = ctx.style().visuals.clone();
+
     ctx.set_visuals(theme.visuals(old));
 }

@dxps

dxps commented May 15, 2026

Copy link
Copy Markdown

I assume that some of us are still waiting for this egui 0.34 support to be in place.

@Lynnesbian Thanks for the contribution! 馃檹


PS (updated initial message):

鈩癸笍 To others like me: to have this compile (even independently, that is using cargo build --no-default-features --features egui34) you need to cargo install catppuccin-whiskers.

@Erik1000

Copy link
Copy Markdown

I assume that some of us are still waiting for this egui 0.34 support to be in place.

Trying to get @Lynnesbian's work in my project fails to compile. Even so when trying cargo build --no-default-features --features egui34 on her work. Am I missing something, please?
Compile errors (click to expand)

Thanks.

I hit the same. The reason is that the src/themes.rs.tera file exists in the repo which leads build.rs wanting to regenerate src/themes.rs with whiskers which is not available.

I "fixed" (well it isnt a bug) it on a fork of the branch Erik1000@ffaa826

@dxps

dxps commented May 15, 2026

Copy link
Copy Markdown

@Erik1000 I had to cargo install catppuccin-whiskers before compiling it.
All good, for now. Lemme check my project now ...

@Erik1000

Copy link
Copy Markdown

@Erik1000 Do I had to cargo install catppuccin-whiskers before compiling it.

you have to if the file exists. my branch works without whiskers

dxps added a commit to dxps/cogs that referenced this pull request May 15, 2026
Until [this PR](catppuccin/egui#102) gets merged.

And now that (mainly as an example) call to `/manifest.json` works using both localhost and 127.0.0.1.
@philpax

philpax commented May 15, 2026

Copy link
Copy Markdown
Contributor

Yep, the build script runs unconditionally, which is problematic for people building it themselves from source. I proposed removing the build script in this issue: #97

@mcthesw

mcthesw commented May 16, 2026

Copy link
Copy Markdown

Upgrading egui currently seems to require waiting for this crate to support the new version too, even though the theme logic is relatively small.

In my own app, I ended up embedding the Catppuccin theme implementation directly into the application code.

I wonder if there is a better way to make this less tightly coupled to egui versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants