mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
Merge branch 'master' of https://github.com/emilk/egui into multiples_viewports
This commit is contained in:
@@ -70,7 +70,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>,
|
||||
) -> ViewportBuilder {
|
||||
let epi::NativeOptions {
|
||||
@@ -173,7 +173,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(
|
||||
@@ -326,6 +329,8 @@ pub struct EpiIntegration {
|
||||
can_drag_window: bool,
|
||||
window_state: WindowState,
|
||||
follow_system_theme: bool,
|
||||
#[cfg(feature = "persistence")]
|
||||
persist_window: bool,
|
||||
app_icon_setter: super::app_icon::AppTitleIconSetter,
|
||||
}
|
||||
|
||||
@@ -388,6 +393,8 @@ impl EpiIntegration {
|
||||
can_drag_window: false,
|
||||
window_state,
|
||||
follow_system_theme: native_options.follow_system_theme,
|
||||
#[cfg(feature = "persistence")]
|
||||
persist_window: native_options.persist_window,
|
||||
app_icon_setter,
|
||||
beginning: Instant::now(),
|
||||
}
|
||||
@@ -578,7 +585,7 @@ impl EpiIntegration {
|
||||
crate::profile_function!();
|
||||
|
||||
if let Some(window) = _window {
|
||||
if _app.persist_native_window() {
|
||||
if self.persist_window {
|
||||
crate::profile_scope!("native_window");
|
||||
epi::set_value(
|
||||
storage,
|
||||
|
||||
@@ -130,6 +130,7 @@ fn save_to_disk(file_path: &PathBuf, kv: &HashMap<String, String>) {
|
||||
let mut writer = std::io::BufWriter::new(file);
|
||||
let config = Default::default();
|
||||
|
||||
crate::profile_scope!("ron::serialize");
|
||||
if let Err(err) = ron::ser::to_writer_pretty(&mut writer, &kv, config)
|
||||
.and_then(|_| writer.flush().map_err(|err| err.into()))
|
||||
{
|
||||
|
||||
@@ -895,7 +895,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!();
|
||||
|
||||
@@ -945,7 +945,7 @@ mod glow_integration {
|
||||
event_loop,
|
||||
storage.as_deref(),
|
||||
&self.app_name,
|
||||
&self.native_options,
|
||||
&mut self.native_options,
|
||||
)?;
|
||||
let gl = Arc::new(gl);
|
||||
|
||||
@@ -1944,7 +1944,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, ViewportBuilder), winit::error::OsError>
|
||||
{
|
||||
crate::profile_function!();
|
||||
@@ -2556,7 +2556,7 @@ mod wgpu_integration {
|
||||
event_loop,
|
||||
running.integration.read().frame.storage(),
|
||||
&self.app_name,
|
||||
&self.native_options,
|
||||
&mut self.native_options,
|
||||
)?;
|
||||
self.set_window(ViewportId::MAIN)?;
|
||||
}
|
||||
@@ -2571,7 +2571,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, builder)?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user