* @brief Activates the theme named by --theme, if any. */
| 640 | * @brief Activates the theme named by --theme, if any. |
| 641 | */ |
| 642 | void CLI::applyThemeOverride() |
| 643 | { |
| 644 | if (!m_parser.isSet(m_opts.themeOpt)) |
| 645 | return; |
| 646 | |
| 647 | const QString name = m_parser.value(m_opts.themeOpt).trimmed(); |
| 648 | if (name.isEmpty()) |
| 649 | return; |
| 650 | |
| 651 | auto& tm = Misc::ThemeManager::instance(); |
| 652 | const QStringList& themes = tm.availableThemes(); |
| 653 | const int idx = themes.indexOf(name); |
| 654 | if (idx < 0) { |
| 655 | qWarning().noquote() << "[CLI] Unknown --theme value:" << name |
| 656 | << "-- available themes:" << themes; |
| 657 | return; |
| 658 | } |
| 659 | |
| 660 | if (runtimeMode()) |
| 661 | tm.setSettingsPersistent(false); |
| 662 | |
| 663 | if (tm.theme() != idx) |
| 664 | tm.setTheme(idx); |
| 665 | } |
| 666 | |
| 667 | /** |
| 668 | * @brief Configures runtime/operator-mode export, dashboard, and taskbar overrides. |