2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Make dark mode update go through Qt code on Linux

This makes the behavior consistent and is possible now thanks to a Qt patch
This commit is contained in:
Ilya Fedin
2023-08-18 16:13:13 +04:00
committed by John Preston
parent 92fec8304e
commit 07bbfd1353
2 changed files with 6 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/random.h"
#include <QtCore/QAbstractEventDispatcher>
#include <qpa/qwindowsysteminterface.h>
#include <glibmm.h>
#include <gio/gio.hpp>
@@ -212,6 +213,9 @@ LinuxIntegration::LinuxIntegration()
const Glib::VariantBase &value) {
if (group == "org.freedesktop.appearance"
&& key == "color-scheme") {
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
QWindowSystemInterface::handleThemeChange();
#else // Qt >= 6.5.0
try {
const auto ivalue = value.get_dynamic<uint>();
@@ -220,6 +224,7 @@ LinuxIntegration::LinuxIntegration()
});
} catch (...) {
}
#endif // Qt < 6.5.0
}
}) {
LOG(("Icon theme: %1").arg(QIcon::themeName()));