MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / switchTheme

Method switchTheme

DSView/pv/mainwindow.cpp:1397–1417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1395 }
1396
1397 void MainWindow::switchTheme(QString style)
1398 {
1399 AppConfig &app = AppConfig::Instance();
1400
1401 if (app.frameOptions.style != style)
1402 {
1403 app.frameOptions.style = style;
1404 app.SaveFrame();
1405 }
1406
1407 QString qssRes = ":/" + style + ".qss";
1408 QFile qss(qssRes);
1409 qss.open(QFile::ReadOnly | QFile::Text);
1410 qApp->setStyleSheet(qss.readAll());
1411 qss.close();
1412
1413 UiManager::Instance()->Update(UI_UPDATE_ACTION_THEME);
1414 UiManager::Instance()->Update(UI_UPDATE_ACTION_FONT);
1415
1416 data_updated();
1417 }
1418
1419 void MainWindow::data_updated()
1420 {

Callers

nothing calls this directly

Calls 3

SaveFrameMethod · 0.80
closeMethod · 0.80
UpdateMethod · 0.80

Tested by

no test coverage detected