MCPcopy Create free account
hub / github.com/IENT/YUView / updateSettings

Method updateSettings

YUViewLib/src/ui/Mainwindow.cpp:776–816  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

774}
775
776void MainWindow::updateSettings()
777{
778 // Set the right theme
779 QSettings settings;
780 QString themeName = settings.value("Theme", "Default").toString();
781 QString themeFile = functions::getThemeFileName(themeName);
782
783 QString styleSheet;
784 if (!themeFile.isEmpty())
785 {
786 // Get the qss text of the theme
787 QFile f(themeFile);
788 if (f.exists())
789 {
790 f.open(QFile::ReadOnly | QFile::Text);
791 QTextStream ts(&f);
792 styleSheet = ts.readAll();
793
794 // Now replace the placeholder color values with the real values
795 QStringList colors = functions::getThemeColors(themeName);
796 if (colors.count() == 4)
797 {
798 styleSheet.replace("#backgroundColor", colors[0]);
799 styleSheet.replace("#activeColor", colors[1]);
800 styleSheet.replace("#inactiveColor", colors[2]);
801 styleSheet.replace("#highlightColor", colors[3]);
802 }
803 else
804 styleSheet.clear();
805 }
806 }
807 // Set the style sheet. If the string is empty, the default will be used/set.
808 qApp->setStyleSheet(styleSheet);
809
810 ui.displaySplitView->updateSettings();
811 separateViewWindow.splitView.updateSettings();
812 ui.playlistTreeWidget->updateSettings();
813 ui.bitstreamAnalysis->updateSettings();
814 this->cache->updateSettings();
815 ui.playbackController->updateSettings();
816}
817
818void MainWindow::saveScreenshot()
819{

Callers

nothing calls this directly

Calls 5

getThemeFileNameFunction · 0.85
getThemeColorsFunction · 0.85
toStringMethod · 0.80
isEmptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected