pub struct Settings<Flags> {
pub id: Option<String>,
pub window: Settings,
pub flags: Flags,
pub default_font: Option<&'static [u8]>,
pub default_text_size: f32,
pub text_multithreading: bool,
pub antialiasing: bool,
pub exit_on_close_request: bool,
pub try_opengles_first: bool,
}
Expand description
The settings of an application.
Fields§
§id: Option<String>
The identifier of the application.
If provided, this identifier may be used to identify the application or communicate with it through the windowing system.
window: Settings
The window settings.
They will be ignored on the Web.
flags: Flags
The data needed to initialize the Application
.
default_font: Option<&'static [u8]>
The bytes of the font that will be used by default.
If None
is provided, a default system font will be chosen.
default_text_size: f32
The text size that will be used by default.
The default value is 20.0
.
text_multithreading: bool
If enabled, spread text workload in multiple threads when multiple cores are available.
By default, it is disabled.
antialiasing: bool
If set to true, the renderer will try to perform antialiasing for some primitives.
Enabling it can produce a smoother result in some widgets, like the
Canvas
, at a performance cost.
By default, it is disabled.
exit_on_close_request: bool
Whether the Application
should exit when the user requests the
window to close (e.g. the user presses the close button).
By default, it is enabled.
try_opengles_first: bool
Whether the Application
should try to build the context
using OpenGL ES first then OpenGL.
By default, it is disabled.
Note: Only works for the glow
backend.
Implementations§
source§impl<Flags> Settings<Flags>
impl<Flags> Settings<Flags>
sourcepub fn with_flags(flags: Flags) -> Self
pub fn with_flags(flags: Flags) -> Self
Initialize Application
settings using the given data.
Trait Implementations§
Auto Trait Implementations§
impl<Flags> RefUnwindSafe for Settings<Flags>where Flags: RefUnwindSafe,
impl<Flags> Send for Settings<Flags>where Flags: Send,
impl<Flags> Sync for Settings<Flags>where Flags: Sync,
impl<Flags> Unpin for Settings<Flags>where Flags: Unpin,
impl<Flags> UnwindSafe for Settings<Flags>where Flags: UnwindSafe,
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: FloatComponent, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere M: TransformMatrix<Swp, Dwp, T>,
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere U: FromColor<T>,
source§fn into_color(self) -> U
fn into_color(self) -> U
source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere U: FromColorUnclamped<T>,
source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere R: Read + ReadEndian<P>, P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere U: TryFromColor<T>,
source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read more