onboarding: Expand power of theme selector (#35421)
Closes #ISSUE The behavior of the theme selector is documented above the function, copied here for reference: ```rust /// separates theme "mode" ("dark" | "light" | "system") into two separate states /// - appearance = "dark" | "light" /// - "system" true/false /// when system selected: /// - toggling between light and dark does not change theme.mode, just which variant will be changed /// when system not selected: /// - toggling between light and dark does change theme.mode /// selecting a theme preview will always change theme.["light" | "dark"] to the selected theme, /// /// this allows for selecting a dark and light theme option regardless of whether the mode is set to system or not /// it does not support setting theme to a static value ``` Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
parent
c6947ee4f0
commit
c946b98ea1
7 changed files with 254 additions and 173 deletions
|
@ -438,7 +438,7 @@ fn default_font_fallbacks() -> Option<FontFallbacks> {
|
|||
|
||||
impl ThemeSettingsContent {
|
||||
/// Sets the theme for the given appearance to the theme with the specified name.
|
||||
pub fn set_theme(&mut self, theme_name: String, appearance: Appearance) {
|
||||
pub fn set_theme(&mut self, theme_name: impl Into<Arc<str>>, appearance: Appearance) {
|
||||
if let Some(selection) = self.theme.as_mut() {
|
||||
let theme_to_update = match selection {
|
||||
ThemeSelection::Static(theme) => theme,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue