diff options
author | 2021-07-22 18:27:33 +0700 | |
---|---|---|
committer | 2021-07-22 18:27:33 +0700 | |
commit | 357a8a95c9820651110fe4d80d8d33a2678827c0 (patch) | |
tree | 54f81a25537b793f6a83cda58549a6cb1e1d9eb9 /src/settings.rs | |
parent | 217f5be8272f48a5b043d066ed1788cc127e1164 (diff) | |
download | iced-357a8a95c9820651110fe4d80d8d33a2678827c0.tar.gz iced-357a8a95c9820651110fe4d80d8d33a2678827c0.tar.bz2 iced-357a8a95c9820651110fe4d80d8d33a2678827c0.zip |
Introduce `text_multithreading` to `Settings`
Diffstat (limited to 'src/settings.rs')
-rw-r--r-- | src/settings.rs | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/settings.rs b/src/settings.rs index 2b32258d..480bf813 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -25,9 +25,11 @@ pub struct Settings<Flags> { /// The default value is 20. pub default_text_size: u16, - /// Whether the [`Application`] should exit when the user requests the - /// window to close (e.g. the user presses the close button). - pub exit_on_close_request: bool, + /// 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. @@ -39,6 +41,12 @@ pub struct Settings<Flags> { /// /// [`Canvas`]: crate::widget::Canvas pub antialiasing: 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. + pub exit_on_close_request: bool, } impl<Flags> Settings<Flags> { @@ -53,8 +61,9 @@ impl<Flags> Settings<Flags> { window: default_settings.window, default_font: default_settings.default_font, default_text_size: default_settings.default_text_size, - exit_on_close_request: default_settings.exit_on_close_request, + text_multithreading: default_settings.text_multithreading, antialiasing: default_settings.antialiasing, + exit_on_close_request: default_settings.exit_on_close_request, } } } @@ -69,8 +78,9 @@ where window: Default::default(), default_font: Default::default(), default_text_size: 20, - exit_on_close_request: true, + text_multithreading: false, antialiasing: false, + exit_on_close_request: true, } } } |