pub struct EguiWindowSettings {
pub title: String,
pub size: Size,
pub min_size: Option<Size>,
pub max_size: Option<Size>,
pub resizable: bool,
pub zoom_factor: f32,
pub graphics: GraphicsConfig,
pub parent: Option<ParentWindowHandle>,
pub wait_for_parent: bool,
pub fallback_scale_factor: Option<f64>,
pub repaint_notifier: Option<RepaintNotifier>,
}Expand description
Settings used when creating a new window
Fields§
§title: StringThe window title.
size: SizeThe size of the window, either in physical or logical coordinates.
min_size: Option<Size>The minimum window size. Set to None for no minimum size.
max_size: Option<Size>The maximum window size. Set to None for no maximum size.
resizable: boolWhether the window can be resized.
zoom_factor: f32The amount of zoom (scaling) to apply. This is applied on top of the system’s native scaling factor.
The zoom factor can also be changed later with
Context::set_zoom_factor().
graphics: GraphicsConfigThe graphics configuration
parent: Option<ParentWindowHandle>If the window is to be embedded in a parent window, the handle to that window.
If None, the window will be standalone.
wait_for_parent: boolIf the window expects to have a parent when first displayed.
Setting this will delay the actual creation of the window until the parent is set (unless the window is shown first).
If the parent field is already set, this does nothing and is ignored.
fallback_scale_factor: Option<f64>A fallback scale factor, if Baseview couldn’t get one from the platform.
If the platform does already provide an accurate scaling factor, this doesn’t do anything.
If the given fallback scale factor is actually useful and different from the current one (1.0 by default), this will resize and redraw the window accordingly.
§Platform compatibility notes.
On Win32, this value is used if running on early versions of Windows 10 (or earlier).
On X11, this value is used if no Xft.dpisetting is set.
On macOS, this function is always a no-op.
repaint_notifier: Option<RepaintNotifier>A realtime-safe handle to request an update & repaint for an egui app.
This can be used, for example, to notify the GUI that the value of a decibel meter has changed.
Implementations§
Source§impl EguiWindowSettings
impl EguiWindowSettings
pub fn new() -> Self
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
The window title.
Sourcepub fn with_size(self, size: impl Into<Size>) -> Self
pub fn with_size(self, size: impl Into<Size>) -> Self
The size of the window, either in physical or logical coordinates.
Sourcepub fn with_resizable(self, resizable: bool) -> Self
pub fn with_resizable(self, resizable: bool) -> Self
Sets whether the window can be resized.
Defaults to true.
Sourcepub fn with_min_size<S: Into<Size>>(self, min_size: Option<S>) -> Self
pub fn with_min_size<S: Into<Size>>(self, min_size: Option<S>) -> Self
The minimum window size. Set to None for no minimum size.
Defaults to None.
Sourcepub fn with_max_size<S: Into<Size>>(self, max_size: Option<S>) -> Self
pub fn with_max_size<S: Into<Size>>(self, max_size: Option<S>) -> Self
The maximum window size. Set to None for no maximum size.
Defaults to None.
Sourcepub fn with_zoom_factor(self, zoom_factor: f32) -> Self
pub fn with_zoom_factor(self, zoom_factor: f32) -> Self
The amount of zoom (scaling) to apply. This is applied on top of the system’s native scaling factor.
This is ignored if size is in physical units.
The zoom factor can also be changed later with
Context::set_zoom_factor().
Sourcepub fn with_parent<'a, P: HasWindowHandle + 'a>(
self,
parent: impl Into<Option<&'a P>>,
) -> Self
pub fn with_parent<'a, P: HasWindowHandle + 'a>( self, parent: impl Into<Option<&'a P>>, ) -> Self
If the window is to be embedded in a parent window, the handle to that window.
If None, the window will be standalone.
Sourcepub fn with_wait_for_parent(self, wait_for_parent: bool) -> Self
pub fn with_wait_for_parent(self, wait_for_parent: bool) -> Self
Sets wait_for_parent to the given value.
Sourcepub fn wait_for_parent(self) -> Self
pub fn wait_for_parent(self) -> Self
Sets wait_for_parent to true.
Sourcepub fn with_fallback_scale_factor(
self,
scale_factor: impl Into<Option<f64>>,
) -> Self
pub fn with_fallback_scale_factor( self, scale_factor: impl Into<Option<f64>>, ) -> Self
Sets fallback_scale_factor to the given value.
Sourcepub fn with_graphics_config(self, config: GraphicsConfig) -> Self
pub fn with_graphics_config(self, config: GraphicsConfig) -> Self
The graphics configuration
Sourcepub fn with_repaint_notifier(self, repaint_notifier: RepaintNotifier) -> Self
pub fn with_repaint_notifier(self, repaint_notifier: RepaintNotifier) -> Self
A clone of the realtime-safe handle to request a update & repaint for an egui app.
This can be used, for example, to notify the GUI that the value of a decibel meter has changed.
Trait Implementations§
Source§impl Clone for EguiWindowSettings
impl Clone for EguiWindowSettings
Source§fn clone(&self) -> EguiWindowSettings
fn clone(&self) -> EguiWindowSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EguiWindowSettings
impl Debug for EguiWindowSettings
Auto Trait Implementations§
impl Freeze for EguiWindowSettings
impl RefUnwindSafe for EguiWindowSettings
impl Send for EguiWindowSettings
impl Sync for EguiWindowSettings
impl Unpin for EguiWindowSettings
impl UnsafeUnpin for EguiWindowSettings
impl UnwindSafe for EguiWindowSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more