зеркало из https://github.com/nextcloud/desktop.git
Use old palette change detection method on Windows 10 and under
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Родитель
7c2102547d
Коммит
d2d91bb105
|
@ -969,8 +969,15 @@ void Theme::connectToPaletteSignal()
|
||||||
{
|
{
|
||||||
if (!_paletteSignalsConnected) {
|
if (!_paletteSignalsConnected) {
|
||||||
if (const auto ptr = qobject_cast<QGuiApplication *>(QGuiApplication::instance())) {
|
if (const auto ptr = qobject_cast<QGuiApplication *>(QGuiApplication::instance())) {
|
||||||
connect(ptr, &QGuiApplication::paletteChanged, this, &Theme::systemPaletteChanged);
|
#ifdef Q_OS_WIN
|
||||||
connect(ptr->styleHints(), &QStyleHints::colorSchemeChanged, this, &Theme::darkModeChanged);
|
// Windows 10 does not have proper dark mode support via Qt 6 so hack detection
|
||||||
|
if (!IsWindows11OrGreater()) {
|
||||||
|
connect(ptr, &QGuiApplication::paletteChanged, this, &Theme::darkModeChanged);
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
connect(ptr->styleHints(), &QStyleHints::colorSchemeChanged, this, &Theme::darkModeChanged);
|
||||||
|
}
|
||||||
_paletteSignalsConnected = true;
|
_paletteSignalsConnected = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче