Index: scribus/ui/factories/scribusproxystyle.cpp =================================================================== --- scribus/ui/factories/scribusproxystyle.cpp (revision 27791 + preceding dark-theme fixes) +++ scribus/ui/factories/scribusproxystyle.cpp (working copy) @@ -273,6 +273,17 @@ #if (QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)) blockRefresh = true; + auto& displayPrefs = PrefsManager::instance().appPrefs.displayPrefs; + const QColor windowColor = qApp->palette().color(QPalette::Active, QPalette::Window); + const QColor baseWindowColor = baseStyle()->standardPalette().color(QPalette::Active, QPalette::Window); + const QColor lightWindowColor = createLightPalette().color(QPalette::Active, QPalette::Window); + const QColor darkWindowColor = createDarkPalette().color(QPalette::Active, QPalette::Window); + // Scratch space historically stores the palette Window color itself. Accept + // palette-derived defaults saved under another theme, while preserving custom colors. + const bool useDefaultScratchColor = + (displayPrefs.scratchColor == windowColor || displayPrefs.scratchColor == baseWindowColor || + displayPrefs.scratchColor == lightWindowColor || displayPrefs.scratchColor == darkWindowColor); + // For Linux exception see bugreport: https://bugreports.qt.io/browse/QTBUG-132929 switch (theme) @@ -300,6 +311,9 @@ break; } + if (useDefaultScratchColor) + displayPrefs.scratchColor = qApp->palette().color(QPalette::Active, QPalette::Window); + blockRefresh = false; #endif } Index: scribus/scribus.cpp =================================================================== --- scribus/scribus.cpp (revision 27791 + preceding dark-theme fixes) +++ scribus/scribus.cpp (working copy) @@ -6582,10 +6582,6 @@ LocaleManager::instance().setUserPreferredLocale(m_prefsManager.appPrefs.uiPrefs.userPreferredLocale); ScQApp->setLocale(); - bool useDefaultScratchColor = false; - if (m_prefsManager.appPrefs.displayPrefs.scratchColor == QApplication::palette().color(QPalette::Active, QPalette::Window)) - useDefaultScratchColor = true; - #if (QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)) QString newUIStylePalette = m_prefsManager.appPrefs.uiPrefs.stylePalette; if (oldPrefs.uiPrefs.stylePalette != newUIStylePalette) @@ -6621,9 +6617,6 @@ // m_prefsManager.appPrefs.uiPrefs.style = oldPrefs.uiPrefs.style; } - if (useDefaultScratchColor) - m_prefsManager.appPrefs.displayPrefs.scratchColor = QApplication::palette().color(QPalette::Active, QPalette::Window); - QString newIconSet = m_prefsManager.guiIconSet(); // Recreate icons if icon set or GUI changed. For GUI change the icon recreation will automatically detect light and dark themes if (oldPrefs.uiPrefs.iconSet != newIconSet || forceIconUpdate == true) @@ -6648,6 +6641,10 @@ else mdiArea->setViewMode(QMdiArea::SubWindowView); bool shadowChanged = oldPrefs.displayPrefs.showPageShadow != m_prefsManager.showPageShadow(); + bool scratchColorChanged = oldPrefs.displayPrefs.scratchColor != m_prefsManager.appPrefs.displayPrefs.scratchColor; + if (scratchColorChanged) + pagePalette->refreshPageGrid(); + QList windows = mdiArea->subWindowList(); if (!windows.isEmpty()) { @@ -6672,7 +6669,7 @@ scw_v->zoom((scw_v->scale() / oldPrefs.displayPrefs.displayScale) * m_prefsManager.displayScale()); zoomSpinBox->setMaximum(doc->opToolPrefs().magMax); } - if (shadowChanged) + if (shadowChanged || scratchColorChanged) scw->view()->DrawNew(); } } Index: scribus/ui/pagepalette.h =================================================================== --- scribus/ui/pagepalette.h (revision 27791 + preceding dark-theme fixes) +++ scribus/ui/pagepalette.h (working copy) @@ -68,6 +68,7 @@ void markPage(uint nr); void updateMasterPageList(); void updatePagePreviews(); + void refreshPageGrid(); void languageChange(); Index: scribus/ui/pagepalette.cpp =================================================================== --- scribus/ui/pagepalette.cpp (revision 27791 + preceding dark-theme fixes) +++ scribus/ui/pagepalette.cpp (working copy) @@ -165,6 +165,12 @@ } +void PagePalette::refreshPageGrid() +{ + if (m_pageWidget) + m_pageWidget->refreshPageGrid(); +} + bool PagePalette::masterPageMode() { PagePalette_MasterPages* mpWidget = dynamic_cast(this->currentWidget()); Index: scribus/ui/pagepalette_pages.h =================================================================== --- scribus/ui/pagepalette_pages.h (revision 27791 + preceding dark-theme fixes) +++ scribus/ui/pagepalette_pages.h (working copy) @@ -27,6 +27,7 @@ public: PagePalette_Pages(QWidget* parent); ~PagePalette_Pages() {}; + void refreshPageGrid(); public slots: void setView(ScribusView *view); Index: scribus/ui/pagepalette_pages.cpp =================================================================== --- scribus/ui/pagepalette_pages.cpp (revision 27791 + preceding dark-theme fixes) +++ scribus/ui/pagepalette_pages.cpp (working copy) @@ -240,6 +240,11 @@ } +void PagePalette_Pages::refreshPageGrid() +{ + pageViewWidget->pageGrid()->update(); +} + void PagePalette_Pages::updatePagePreview() { if (currView == nullptr || pageViewWidget->pageGrid()->pageList.empty())