| 774 | } |
| 775 | |
| 776 | void 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 | |
| 818 | void MainWindow::saveScreenshot() |
| 819 | { |
nothing calls this directly
no test coverage detected