mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Make use of the new XDP::SettingWatcher constructor
This commit is contained in:
parent
3c931b11d6
commit
cb838e6e52
1 changed files with 5 additions and 12 deletions
|
@ -207,24 +207,17 @@ LinuxIntegration::LinuxIntegration()
|
||||||
base::Platform::XDP::kService,
|
base::Platform::XDP::kService,
|
||||||
base::Platform::XDP::kObjectPath,
|
base::Platform::XDP::kObjectPath,
|
||||||
nullptr))
|
nullptr))
|
||||||
, _darkModeWatcher([](
|
, _darkModeWatcher(
|
||||||
const Glib::ustring &group,
|
"org.freedesktop.appearance",
|
||||||
const Glib::ustring &key,
|
"color-scheme",
|
||||||
const Glib::VariantBase &value) {
|
[](uint value) {
|
||||||
if (group == "org.freedesktop.appearance"
|
|
||||||
&& key == "color-scheme") {
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||||
QWindowSystemInterface::handleThemeChange();
|
QWindowSystemInterface::handleThemeChange();
|
||||||
#else // Qt >= 6.5.0
|
#else // Qt >= 6.5.0
|
||||||
Core::Sandbox::Instance().customEnterFromEventLoop([&] {
|
Core::Sandbox::Instance().customEnterFromEventLoop([&] {
|
||||||
try {
|
Core::App().settings().setSystemDarkMode(value == 1);
|
||||||
Core::App().settings().setSystemDarkMode(
|
|
||||||
value.get_dynamic<uint>() == 1);
|
|
||||||
} catch (...) {
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
#endif // Qt < 6.5.0
|
#endif // Qt < 6.5.0
|
||||||
}
|
|
||||||
}) {
|
}) {
|
||||||
LOG(("Icon theme: %1").arg(QIcon::themeName()));
|
LOG(("Icon theme: %1").arg(QIcon::themeName()));
|
||||||
LOG(("Fallback icon theme: %1").arg(QIcon::fallbackThemeName()));
|
LOG(("Fallback icon theme: %1").arg(QIcon::fallbackThemeName()));
|
||||||
|
|
Loading…
Add table
Reference in a new issue