summaryrefslogtreecommitdiffstats
path: root/src/settings.rs
diff options
context:
space:
mode:
authorLibravatar Bingus <shankern@protonmail.com>2023-07-12 12:23:18 -0700
committerLibravatar Bingus <shankern@protonmail.com>2023-07-12 12:23:18 -0700
commit633f405f3f78bc7f82d2b2061491b0e011137451 (patch)
tree5ebfc1f45d216a5c14a90492563599e6969eab4d /src/settings.rs
parent41836dd80d0534608e7aedfbf2319c540a23de1a (diff)
parent21bd51426d900e271206f314e0c915dd41065521 (diff)
downloadiced-633f405f3f78bc7f82d2b2061491b0e011137451.tar.gz
iced-633f405f3f78bc7f82d2b2061491b0e011137451.tar.bz2
iced-633f405f3f78bc7f82d2b2061491b0e011137451.zip
Merge remote-tracking branch 'origin/master' into feat/multi-window-support
# Conflicts: # Cargo.toml # core/src/window/icon.rs # core/src/window/id.rs # core/src/window/position.rs # core/src/window/settings.rs # examples/integration/src/main.rs # examples/integration_opengl/src/main.rs # glutin/src/application.rs # native/src/subscription.rs # native/src/window.rs # runtime/src/window/action.rs # src/lib.rs # src/window.rs # winit/Cargo.toml # winit/src/application.rs # winit/src/icon.rs # winit/src/settings.rs # winit/src/window.rs
Diffstat (limited to 'src/settings.rs')
-rw-r--r--src/settings.rs32
1 files changed, 6 insertions, 26 deletions
diff --git a/src/settings.rs b/src/settings.rs
index 0eb3e62d..0dd46584 100644
--- a/src/settings.rs
+++ b/src/settings.rs
@@ -1,5 +1,6 @@
//! Configure your application.
use crate::window;
+use crate::Font;
/// The settings of an application.
#[derive(Debug, Clone)]
@@ -20,23 +21,16 @@ pub struct Settings<Flags> {
/// [`Application`]: crate::Application
pub flags: Flags,
- /// The bytes of the font that will be used by default.
+ /// The default [`Font`] to be used.
///
- /// If `None` is provided, a default system font will be chosen.
- // TODO: Add `name` for web compatibility
- pub default_font: Option<&'static [u8]>,
+ /// By default, it uses [`Font::SansSerif`].
+ pub default_font: Font,
/// The text size that will be used by default.
///
- /// The default value is `20.0`.
+ /// The default value is `16.0`.
pub default_text_size: f32,
- /// If enabled, spread text workload in multiple threads when multiple cores
- /// are available.
- ///
- /// By default, it is disabled.
- pub text_multithreading: bool,
-
/// If set to true, the renderer will try to perform antialiasing for some
/// primitives.
///
@@ -55,15 +49,6 @@ pub struct Settings<Flags> {
///
/// [`Application`]: crate::Application
pub exit_on_close_request: 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.
- ///
- /// [`Application`]: crate::Application
- pub try_opengles_first: bool,
}
impl<Flags> Settings<Flags> {
@@ -79,10 +64,8 @@ impl<Flags> Settings<Flags> {
window: default_settings.window,
default_font: default_settings.default_font,
default_text_size: default_settings.default_text_size,
- text_multithreading: default_settings.text_multithreading,
antialiasing: default_settings.antialiasing,
exit_on_close_request: default_settings.exit_on_close_request,
- try_opengles_first: default_settings.try_opengles_first,
}
}
}
@@ -97,11 +80,9 @@ where
window: Default::default(),
flags: Default::default(),
default_font: Default::default(),
- default_text_size: 20.0,
- text_multithreading: false,
+ default_text_size: 16.0,
antialiasing: false,
exit_on_close_request: true,
- try_opengles_first: false,
}
}
}
@@ -113,7 +94,6 @@ impl<Flags> From<Settings<Flags>> for iced_winit::Settings<Flags> {
window: settings.window.into(),
flags: settings.flags,
exit_on_close_request: settings.exit_on_close_request,
- try_opengles_first: settings.try_opengles_first,
}
}
}