mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
Add NativeOptions::window_builder for more customization (#3390)
* added a window builder hook for more customization * `EFrame` -> `eframe` --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
@@ -75,7 +75,7 @@ pub fn read_window_info(
|
||||
pub fn window_builder<E>(
|
||||
event_loop: &EventLoopWindowTarget<E>,
|
||||
title: &str,
|
||||
native_options: &epi::NativeOptions,
|
||||
native_options: &mut epi::NativeOptions,
|
||||
window_settings: Option<WindowSettings>,
|
||||
) -> winit::window::WindowBuilder {
|
||||
let epi::NativeOptions {
|
||||
@@ -179,7 +179,10 @@ pub fn window_builder<E>(
|
||||
}
|
||||
}
|
||||
|
||||
window_builder
|
||||
match std::mem::take(&mut native_options.window_builder) {
|
||||
Some(hook) => hook(window_builder),
|
||||
None => window_builder,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn apply_native_options_to_window(
|
||||
|
||||
@@ -702,7 +702,7 @@ mod glow_integration {
|
||||
event_loop: &EventLoopWindowTarget<UserEvent>,
|
||||
storage: Option<&dyn epi::Storage>,
|
||||
title: &str,
|
||||
native_options: &NativeOptions,
|
||||
native_options: &mut NativeOptions,
|
||||
) -> Result<(GlutinWindowContext, glow::Context)> {
|
||||
crate::profile_function!();
|
||||
|
||||
@@ -749,7 +749,7 @@ mod glow_integration {
|
||||
event_loop,
|
||||
storage.as_deref(),
|
||||
&self.app_name,
|
||||
&self.native_options,
|
||||
&mut self.native_options,
|
||||
)?;
|
||||
let gl = Arc::new(gl);
|
||||
|
||||
@@ -1184,7 +1184,7 @@ mod wgpu_integration {
|
||||
event_loop: &EventLoopWindowTarget<UserEvent>,
|
||||
storage: Option<&dyn epi::Storage>,
|
||||
title: &str,
|
||||
native_options: &NativeOptions,
|
||||
native_options: &mut NativeOptions,
|
||||
) -> std::result::Result<winit::window::Window, winit::error::OsError> {
|
||||
crate::profile_function!();
|
||||
|
||||
@@ -1439,7 +1439,7 @@ mod wgpu_integration {
|
||||
event_loop,
|
||||
running.integration.frame.storage(),
|
||||
&self.app_name,
|
||||
&self.native_options,
|
||||
&mut self.native_options,
|
||||
)?;
|
||||
self.set_window(window)?;
|
||||
}
|
||||
@@ -1454,7 +1454,7 @@ mod wgpu_integration {
|
||||
event_loop,
|
||||
storage.as_deref(),
|
||||
&self.app_name,
|
||||
&self.native_options,
|
||||
&mut self.native_options,
|
||||
)?;
|
||||
self.init_run_state(event_loop, storage, window)?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user