mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
add set_minimized for Frame
This commit is contained in:
@@ -789,6 +789,12 @@ impl Frame {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Minimize or un-minimize window
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
|
pub fn set_minimized(&mut self, minimized: bool) {
|
||||||
|
self.output.minimized = Some(minimized);
|
||||||
|
}
|
||||||
|
|
||||||
/// for integrations only: call once per frame
|
/// for integrations only: call once per frame
|
||||||
pub(crate) fn take_app_output(&mut self) -> backend::AppOutput {
|
pub(crate) fn take_app_output(&mut self) -> backend::AppOutput {
|
||||||
std::mem::take(&mut self.output)
|
std::mem::take(&mut self.output)
|
||||||
@@ -1002,5 +1008,9 @@ pub(crate) mod backend {
|
|||||||
/// Set to some bool to tell the window always on top.
|
/// Set to some bool to tell the window always on top.
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
pub always_on_top: Option<bool>,
|
pub always_on_top: Option<bool>,
|
||||||
|
|
||||||
|
/// Set to some bool to change window minimization
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
|
pub minimized: Option<bool>,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,6 +180,7 @@ pub fn handle_app_output(
|
|||||||
window_pos,
|
window_pos,
|
||||||
visible: _, // handled in post_present
|
visible: _, // handled in post_present
|
||||||
always_on_top,
|
always_on_top,
|
||||||
|
minimized,
|
||||||
} = app_output;
|
} = app_output;
|
||||||
|
|
||||||
if let Some(decorated) = decorated {
|
if let Some(decorated) = decorated {
|
||||||
@@ -218,6 +219,10 @@ pub fn handle_app_output(
|
|||||||
if let Some(always_on_top) = always_on_top {
|
if let Some(always_on_top) = always_on_top {
|
||||||
window.set_always_on_top(always_on_top);
|
window.set_always_on_top(always_on_top);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(minimized) = minimized {
|
||||||
|
window.set_minimized(minimized);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user