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

[eframe] Make persistence, http and time optional features

Saves on compile times.
This commit is contained in:
Emil Ernerfeldt
2021-01-04 01:44:02 +01:00
parent 00269f96c0
commit 69d31a5e47
30 changed files with 412 additions and 303 deletions

View File

@@ -1,7 +1,6 @@
use crate::*;
pub use egui::{pos2, Color32};
use http::WebHttp;
// ----------------------------------------------------------------------------
@@ -144,7 +143,8 @@ pub struct AppRunner {
pub(crate) needs_repaint: std::sync::Arc<NeedRepaint>,
storage: LocalStorage,
last_save_time: f64,
http: Arc<WebHttp>,
#[cfg(feature = "http")]
http: Arc<http::WebHttp>,
}
impl AppRunner {
@@ -160,7 +160,8 @@ impl AppRunner {
needs_repaint: Default::default(),
storage,
last_save_time: now_sec(),
http: Arc::new(WebHttp {}),
#[cfg(feature = "http")]
http: Arc::new(http::WebHttp {}),
})
}
@@ -210,6 +211,7 @@ impl AppRunner {
native_pixels_per_point: Some(native_pixels_per_point()),
},
tex_allocator: Some(&mut self.web_backend.painter),
#[cfg(feature = "http")]
http: self.http.clone(),
output: &mut app_output,
repaint_signal: self.needs_repaint.clone(),