mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Use cppgir compatible XDP utilities API
This commit is contained in:
parent
59e53c1edf
commit
3689e7dfbc
2 changed files with 4 additions and 4 deletions
|
@ -197,12 +197,12 @@ LinuxIntegration::LinuxIntegration()
|
|||
, _darkModeWatcher(
|
||||
"org.freedesktop.appearance",
|
||||
"color-scheme",
|
||||
[](uint value) {
|
||||
[](GLib::Variant value) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
QWindowSystemInterface::handleThemeChange();
|
||||
#else // Qt >= 6.5.0
|
||||
Core::Sandbox::Instance().customEnterFromEventLoop([&] {
|
||||
Core::App().settings().setSystemDarkMode(value == 1);
|
||||
Core::App().settings().setSystemDarkMode(value.get_uint32() == 1);
|
||||
});
|
||||
#endif // Qt < 6.5.0
|
||||
}) {
|
||||
|
|
|
@ -512,12 +512,12 @@ QString SingleInstanceLocalServerName(const QString &hash) {
|
|||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||
std::optional<bool> IsDarkMode() {
|
||||
const auto result = base::Platform::XDP::ReadSetting<uint>(
|
||||
const auto result = base::Platform::XDP::ReadSetting(
|
||||
"org.freedesktop.appearance",
|
||||
"color-scheme");
|
||||
|
||||
return result.has_value()
|
||||
? std::make_optional(*result == 1)
|
||||
? std::make_optional(result->get_uint32() == 1)
|
||||
: std::nullopt;
|
||||
}
|
||||
#endif // Qt < 6.5.0
|
||||
|
|
Loading…
Add table
Reference in a new issue