Merge branch 'master' of https://github.com/DioxusLabs/dioxus into lazy_tui
This commit is contained in:
commit
84db875101
22 files changed
+746
-110
No files matched your search
@@ -1,11 +1,39 @@
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
pub struct Config {
|
||||
pub rendering_mode: RenderingMode,
|
||||
pub(crate) rendering_mode: RenderingMode,
|
||||
/// Controls if the terminal quit when the user presses `ctrl+c`?
|
||||
/// To handle quiting on your own, use the [crate::TuiContext] root context.
|
||||
pub ctrl_c_quit: bool,
|
||||
pub(crate) ctrl_c_quit: bool,
|
||||
/// Controls if the terminal should dislay anything, usefull for testing.
|
||||
pub headless: bool,
|
||||
pub(crate) headless: bool,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
pub fn new() -> Self {
|
||||
Self::default()
|
||||
}
|
||||
|
||||
pub fn with_rendering_mode(self, rendering_mode: RenderingMode) -> Self {
|
||||
Self {
|
||||
rendering_mode,
|
||||
..self
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_ctrl_c_quit(self) -> Self {
|
||||
Self {
|
||||
ctrl_c_quit: true,
|
||||
..self
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_headless(self) -> Self {
|
||||
Self {
|
||||
headless: true,
|
||||
..self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
|
||||
Reference in new issue
Block a user