MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / refreshTheme

Method refreshTheme

MiniZincIDE/ide.cpp:688–708  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

686}
687
688void IDE::refreshTheme()
689{
690 auto& theme = themeManager->current();
691 bool darkMode = darkModeNotifier->darkMode();
692 static_cast<CodeEditor*>(cheatSheet->centralWidget())->setTheme(theme, darkMode);
693
694 if (!darkModeNotifier->hasNativeDarkMode()) {
695 // No native dark widgets, so use stylesheet instead
696 if (darkMode) {
697 QFile sheet(":/dark_mode.css");
698 sheet.open(QFile::ReadOnly);
699 qApp->setStyleSheet(sheet.readAll());
700 } else {
701 qApp->setStyleSheet("");
702 }
703 }
704
705 for (auto* mw : qAsConst(mainWindows)) {
706 mw->setTheme(theme, darkMode);
707 }
708}

Calls 4

currentMethod · 0.80
darkModeMethod · 0.80
hasNativeDarkModeMethod · 0.80
setThemeMethod · 0.45

Tested by

no test coverage detected