1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 05:10:03 -04:00

Move egui::app into new epi crate

This commit is contained in:
Emil Ernerfeldt
2020-12-29 14:15:46 +01:00
parent 6953dc7d5d
commit d7459bc13d
21 changed files with 157 additions and 72 deletions

View File

@@ -11,6 +11,7 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
egui = { path = "../egui", features = ["serde"] }
egui_web = { path = "../egui_web" }
epi = { version = "0.6.0", path = "../epi", features = ["serde", "serde_json"] }
image = { version = "0.23", default_features = false, features = ["jpeg", "png"] }
js-sys = "0.3"
serde = { version = "1", features = ["derive"] }

View File

@@ -48,14 +48,14 @@ impl Default for ExampleApp {
}
}
impl egui::app::App for ExampleApp {
impl epi::App for ExampleApp {
fn name(&self) -> &str {
"Egui Fetch Example"
}
/// Called each time the UI needs repainting, which may be many times per second.
/// Put your widgets into a `SidePanel`, `TopPanel`, `CentralPanel`, `Window` or `Area`.
fn ui(&mut self, ctx: &egui::CtxRef, integration_context: &mut egui::app::IntegrationContext) {
fn ui(&mut self, ctx: &egui::CtxRef, integration_context: &mut epi::IntegrationContext) {
if let Some(receiver) = &mut self.in_progress {
// Are we there yet?
if let Ok(result) = receiver.try_recv() {
@@ -137,7 +137,7 @@ fn ui_url(ui: &mut egui::Ui, url: &mut String) -> Option<String> {
fn ui_resouce(
ui: &mut egui::Ui,
integration_context: &mut egui::app::IntegrationContext,
integration_context: &mut epi::IntegrationContext,
tex_mngr: &mut TexMngr,
resource: &Resource,
) {
@@ -250,7 +250,7 @@ struct TexMngr {
impl TexMngr {
fn texture(
&mut self,
integration_context: &mut egui::app::IntegrationContext,
integration_context: &mut epi::IntegrationContext,
url: &str,
image: &Image,
) -> Option<egui::TextureId> {