Skip to content

Commit

Permalink
Update to latest egui master
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Nov 20, 2023
1 parent 3d51777 commit b523407
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 38 deletions.
70 changes: 42 additions & 28 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 @@ -3,3 +3,5 @@ resolver = "2"
members = ["puffin", "puffin_egui", "puffin_http", "puffin_viewer"]

[patch.crates-io]
eframe = { git = "https://github.com/emilk/egui.git", rev = "7bfaf4963676d02a88000b900b46365a827e0b65" } # egui master 2023-11-19
egui = { git = "https://github.com/emilk/egui.git", rev = "7bfaf4963676d02a88000b900b46365a827e0b65" } # egui master 2023-11-19
4 changes: 2 additions & 2 deletions puffin_egui/examples/eframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ pub struct ExampleApp {
}

impl eframe::App for ExampleApp {
fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
puffin::profile_function!();
puffin::GlobalProfiler::lock().new_frame(); // call once per frame!

egui::CentralPanel::default().show(ctx, |ui| {
if ui.button("Quit").clicked() {
frame.close()
ui.ctx().send_viewport_cmd(egui::ViewportCommand::Close);
}
});

Expand Down
6 changes: 3 additions & 3 deletions puffin_viewer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl PuffinViewer {
}

#[cfg(not(target_arch = "wasm32"))]
fn ui_menu_bar(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
fn ui_menu_bar(&mut self, ctx: &egui::Context) {
if ctx.input(|i| i.modifiers.command && i.key_pressed(egui::Key::O)) {
self.open_dialog();
}
Expand All @@ -242,7 +242,7 @@ impl PuffinViewer {
}

if ui.button("Quit").clicked() {
frame.close();
ui.ctx().send_viewport_cmd(egui::ViewportCommand::Close);
}
});
ui.menu_button("View", |ui| {
Expand Down Expand Up @@ -295,7 +295,7 @@ impl eframe::App for PuffinViewer {

#[cfg(not(target_arch = "wasm32"))]
{
self.ui_menu_bar(ctx, _frame);
self.ui_menu_bar(ctx);
}

#[cfg(target_arch = "wasm32")]
Expand Down
10 changes: 5 additions & 5 deletions puffin_viewer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ fn main() {
Source::Http(puffin_http::Client::new(opt.url))
};

let icon = eframe::icon_data::from_png_bytes(include_bytes!("../icon.png")).unwrap();
let native_options = eframe::NativeOptions {
app_id: Some("puffin_viewer".to_owned()),
icon_data: Some(
eframe::IconData::try_from_png_bytes(include_bytes!("../icon.png")).unwrap(),
),
drag_and_drop_support: true,
viewport: eframe::egui::ViewportBuilder::default()
.with_app_id("puffin_viewer")
.with_drag_and_drop(true)
.with_window_icon(icon),
..Default::default()
};

Expand Down

0 comments on commit b523407

Please sign in to comment.