mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -04:00
Improve clippy, and add more docs (#3306)
* Silence a few clippy warnings * Use named threads * Remove some deprecated functions * Document Context and Ui fully * Use `parking_lot::Mutex` in `eframe` * Expand clippy.toml files * build fix
This commit is contained in:
@@ -96,6 +96,8 @@ egui = { version = "0.22.0", path = "../egui", default-features = false, feature
|
||||
"log",
|
||||
] }
|
||||
log = { version = "0.4", features = ["std"] }
|
||||
parking_lot = "0.12"
|
||||
static_assertions = "1.1.0"
|
||||
thiserror.workspace = true
|
||||
|
||||
#! ### Optional dependencies
|
||||
@@ -106,7 +108,6 @@ egui_glow = { version = "0.22.0", path = "../egui_glow", optional = true, defaul
|
||||
glow = { version = "0.12", optional = true }
|
||||
ron = { version = "0.8", optional = true, features = ["integer128"] }
|
||||
serde = { version = "1", optional = true, features = ["derive"] }
|
||||
static_assertions = "1.1.0"
|
||||
|
||||
# -------------------------------------------
|
||||
# native:
|
||||
|
||||
@@ -1092,6 +1092,8 @@ pub use glow_integration::run_glow;
|
||||
mod wgpu_integration {
|
||||
use std::sync::Arc;
|
||||
|
||||
use parking_lot::Mutex;
|
||||
|
||||
use super::*;
|
||||
|
||||
/// State that is initialized when the application is first starts running via
|
||||
@@ -1104,7 +1106,7 @@ mod wgpu_integration {
|
||||
}
|
||||
|
||||
struct WgpuWinitApp {
|
||||
repaint_proxy: Arc<std::sync::Mutex<EventLoopProxy<UserEvent>>>,
|
||||
repaint_proxy: Arc<Mutex<EventLoopProxy<UserEvent>>>,
|
||||
app_name: String,
|
||||
native_options: epi::NativeOptions,
|
||||
app_creator: Option<epi::AppCreator>,
|
||||
@@ -1130,7 +1132,7 @@ mod wgpu_integration {
|
||||
);
|
||||
|
||||
Self {
|
||||
repaint_proxy: Arc::new(std::sync::Mutex::new(event_loop.create_proxy())),
|
||||
repaint_proxy: Arc::new(Mutex::new(event_loop.create_proxy())),
|
||||
app_name: app_name.to_owned(),
|
||||
native_options,
|
||||
running: None,
|
||||
@@ -1215,7 +1217,7 @@ mod wgpu_integration {
|
||||
);
|
||||
#[cfg(feature = "accesskit")]
|
||||
{
|
||||
integration.init_accesskit(&window, self.repaint_proxy.lock().unwrap().clone());
|
||||
integration.init_accesskit(&window, self.repaint_proxy.lock().clone());
|
||||
}
|
||||
let theme = system_theme.unwrap_or(self.native_options.default_theme);
|
||||
integration.egui_ctx.set_visuals(theme.egui_visuals());
|
||||
@@ -1232,7 +1234,6 @@ mod wgpu_integration {
|
||||
let frame_nr = info.current_frame_nr;
|
||||
event_loop_proxy
|
||||
.lock()
|
||||
.unwrap()
|
||||
.send_event(UserEvent::RequestRepaint { when, frame_nr })
|
||||
.ok();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user