mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 21:00:03 -04:00
Fix some clippy warning from Rust 1.78.0 (#4444)
This commit is contained in:
@@ -360,21 +360,6 @@ impl WinitApp for GlowWinitApp {
|
||||
.map_or(0, |r| r.integration.egui_ctx.frame_nr_for(viewport_id))
|
||||
}
|
||||
|
||||
fn is_focused(&self, window_id: WindowId) -> bool {
|
||||
if let Some(running) = &self.running {
|
||||
let glutin = running.glutin.borrow();
|
||||
if let Some(window_id) = glutin.viewport_from_window.get(&window_id) {
|
||||
return glutin.focused_viewport == Some(*window_id);
|
||||
}
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
fn integration(&self) -> Option<&EpiIntegration> {
|
||||
self.running.as_ref().map(|r| &r.integration)
|
||||
}
|
||||
|
||||
fn window(&self, window_id: WindowId) -> Option<Arc<Window>> {
|
||||
let running = self.running.as_ref()?;
|
||||
let glutin = running.glutin.borrow();
|
||||
|
||||
@@ -341,20 +341,6 @@ impl WinitApp for WgpuWinitApp {
|
||||
.map_or(0, |r| r.integration.egui_ctx.frame_nr_for(viewport_id))
|
||||
}
|
||||
|
||||
fn is_focused(&self, window_id: WindowId) -> bool {
|
||||
if let Some(running) = &self.running {
|
||||
let shared = running.shared.borrow();
|
||||
let viewport_id = shared.viewport_from_window.get(&window_id).copied();
|
||||
shared.focused_viewport.is_some() && shared.focused_viewport == viewport_id
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
fn integration(&self) -> Option<&EpiIntegration> {
|
||||
self.running.as_ref().map(|r| &r.integration)
|
||||
}
|
||||
|
||||
fn window(&self, window_id: WindowId) -> Option<Arc<Window>> {
|
||||
self.running
|
||||
.as_ref()
|
||||
|
||||
@@ -9,8 +9,6 @@ use egui::ViewportId;
|
||||
#[cfg(feature = "accesskit")]
|
||||
use egui_winit::accesskit_winit;
|
||||
|
||||
use super::epi_integration::EpiIntegration;
|
||||
|
||||
/// Create an egui context, restoring it from storage if possible.
|
||||
pub fn create_egui_context(storage: Option<&dyn crate::Storage>) -> egui::Context {
|
||||
crate::profile_function!();
|
||||
@@ -64,10 +62,6 @@ pub trait WinitApp {
|
||||
/// The current frame number, as reported by egui.
|
||||
fn frame_nr(&self, viewport_id: ViewportId) -> u64;
|
||||
|
||||
fn is_focused(&self, window_id: WindowId) -> bool;
|
||||
|
||||
fn integration(&self) -> Option<&EpiIntegration>;
|
||||
|
||||
fn window(&self, window_id: WindowId) -> Option<Arc<Window>>;
|
||||
|
||||
fn window_id_from_viewport_id(&self, id: ViewportId) -> Option<WindowId>;
|
||||
|
||||
Reference in New Issue
Block a user