Reload theme using ThemeSettings::reload_current_theme (#7522)

This PR updates the various spots where we reload the theme to use
`ThemeSettings::reload_current_theme` instead of duplicating the code
each time.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-02-07 16:56:24 -05:00 committed by GitHub
parent 45cf36e870
commit 374c8a4c8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 36 deletions

View file

@ -34,6 +34,10 @@ pub struct ThemeSettings {
}
impl ThemeSettings {
/// Reloads the current theme.
///
/// Reads the [`ThemeSettings`] to know which theme should be loaded,
/// taking into account the current [`SystemAppearance`].
pub fn reload_current_theme(cx: &mut AppContext) {
let mut theme_settings = ThemeSettings::get_global(cx).clone();