File tree Expand file tree Collapse file tree 2 files changed +20
-29
lines changed
Expand file tree Collapse file tree 2 files changed +20
-29
lines changed Original file line number Diff line number Diff line change @@ -1143,17 +1143,6 @@ void MainWindow::translateExtras(int init) {
11431143 }
11441144}
11451145
1146- static void repolishAfterThemeChanged () {
1147- const auto widgets = QApplication::allWidgets ();
1148- for (QWidget *w : widgets) {
1149- if (QStyle *st = w->style ()) {
1150- st->unpolish (w);
1151- st->polish (w);
1152- }
1153- w->update ();
1154- }
1155- }
1156-
11571146void MainWindow::applyThemeFromPreference () {
11581147 Qt::ColorScheme scheme = Qt::ColorScheme::Unknown;
11591148 bool explicitScheme = false ;
@@ -1185,6 +1174,8 @@ void MainWindow::applyThemeFromPreference() {
11851174 }
11861175 }
11871176 }
1177+ #elif defined(Q_OS_MACOS)
1178+ Q_UNUSED (explicitScheme);
11881179#else
11891180 if (explicitScheme) {
11901181 if (QStyle *fusion = QStyleFactory::create (" Fusion" _L1)) {
@@ -1195,7 +1186,6 @@ void MainWindow::applyThemeFromPreference() {
11951186
11961187 const bool dark = (qApp->styleHints ()->colorScheme () == Qt::ColorScheme::Dark);
11971188 darkModeSwitch (dark);
1198- repolishAfterThemeChanged ();
11991189}
12001190
12011191void MainWindow::darkModeSwitch (bool darkMode) {
@@ -1227,7 +1217,6 @@ void MainWindow::changeEvent(QEvent* event) {
12271217 eventType == QEvent::PaletteChange) {
12281218 const bool dark = (qApp->styleHints ()->colorScheme () == Qt::ColorScheme::Dark);
12291219 darkModeSwitch (dark);
1230- repolishAfterThemeChanged ();
12311220 }
12321221}
12331222
Original file line number Diff line number Diff line change 76827682 </item >
76837683 </widget >
76847684 </item >
7685- <item row =" 0" column =" 8 " >
7685+ <item row =" 0" column =" 10 " >
76867686 <spacer name =" horizontalSpacer_7" >
76877687 <property name =" orientation" >
76887688 <enum >Qt::Horizontal</enum >
77717771 </property >
77727772 </spacer >
77737773 </item >
7774- <item row =" 1 " column =" 0 " >
7774+ <item row =" 0 " column =" 8 " >
77757775 <widget class =" QLabel" name =" labelTheme" >
77767776 <property name =" text" >
77777777 <string >Theme:</string >
77787778 </property >
77797779 </widget >
77807780 </item >
7781- <item row =" 1 " column =" 1 " colspan = " 7 " >
7781+ <item row =" 0 " column =" 9 " >
77827782 <widget class =" QComboBox" name =" comboTheme" >
7783+ <property name =" sizePolicy" >
7784+ <sizepolicy hsizetype =" Maximum" vsizetype =" Fixed" >
7785+ <horstretch >0</horstretch >
7786+ <verstretch >0</verstretch >
7787+ </sizepolicy >
7788+ </property >
7789+ <property name =" sizeAdjustPolicy" >
7790+ <enum >QComboBox::AdjustToContents</enum >
7791+ </property >
7792+ <property name =" maximumSize" >
7793+ <size >
7794+ <width >200</width >
7795+ <height >16777215</height >
7796+ </size >
7797+ </property >
77837798 <item >
77847799 <property name =" text" >
77857800 <string >System Default</string >
77977812 </item >
77987813 </widget >
77997814 </item >
7800- <item row =" 1" column =" 8" >
7801- <spacer name =" horizontalSpacerTheme" >
7802- <property name =" orientation" >
7803- <enum >Qt::Horizontal</enum >
7804- </property >
7805- <property name =" sizeHint" stdset =" 0" >
7806- <size >
7807- <width >0</width >
7808- <height >20</height >
7809- </size >
7810- </property >
7811- </spacer >
7812- </item >
78137815 </layout >
78147816 </widget >
78157817 </item >
You can’t perform that action at this time.
0 commit comments