Themes
Themes are a way to change the look and feel of the application. A theme is a collection of colors, fonts, and other settings that are used to draw the controls. AppCUI comes with a set of predefined themes that can be used out of the box. You can also create your own themes by modifying the predefined ones or by creating a new one from scratch.
To create a new theme, you need to create a new instance of the Theme structure and set the desired colors, fonts, and other settings. You can then apply the theme to the application using the .theme(...) method on the application Builder.
#![allow(unused)] fn main() { let mut my_theme = Theme::new(Themes::Default); // modify my_theme (colors, characters, etc.) let mut app = App::new().theme(my_theme).build().expect("Failed to create an AppCUI application"); // add additional windows app.run(); }
Alternatively, you can call the set_theme method on App later during execution.
#![allow(unused)] fn main() { let mut my_theme = Theme::new(Themes::Default); // modify my_theme (colors, characters, etc.) App::set_theme(my_theme); }
If not specified, the default theme (Themes::Default) will be used.