| 22 | } |
| 23 | |
| 24 | void ThemeManager::initialize(AppearanceConfiguration *config, ThemeRepository *repository) |
| 25 | { |
| 26 | this->config = config; |
| 27 | this->repository = repository; |
| 28 | |
| 29 | auto *styleHints = qGuiApp->styleHints(); |
| 30 | |
| 31 | // Re-resolve when OS color scheme changes (relevant for FollowSystem mode) |
| 32 | connect(styleHints, &QStyleHints::colorSchemeChanged, this, &ThemeManager::resolveTheme, Qt::QueuedConnection); |
| 33 | |
| 34 | // Re-resolve when the user changes any theme setting |
| 35 | connect(config, &AppearanceConfiguration::selectionChanged, this, &ThemeManager::resolveTheme); |
| 36 | |
| 37 | resolveTheme(); |
| 38 | } |
| 39 | |
| 40 | void ThemeManager::setTheme(const Theme &theme) |
| 41 | { |