mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Add 'respect system dark mode' checkbox.
This commit is contained in:
@@ -69,6 +69,8 @@ constexpr auto kPropertiesInterface = "org.freedesktop.DBus.Properties"_cs;
|
||||
|
||||
QStringList PlatformThemes;
|
||||
|
||||
bool IsTrayIconSupported = true;
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||
void PortalAutostart(bool autostart, bool silent = false) {
|
||||
QVariantMap options;
|
||||
@@ -871,8 +873,7 @@ std::optional<crl::time> LastUserInputTime() {
|
||||
|
||||
std::optional<bool> IsDarkMode() {
|
||||
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
|
||||
if (Libs::GtkSettingSupported()
|
||||
&& Libs::GtkLoaded()) {
|
||||
if (Libs::GtkSettingSupported() && Libs::GtkLoaded()) {
|
||||
if (Libs::gtk_check_version != nullptr
|
||||
&& !Libs::gtk_check_version(3, 0, 0)
|
||||
&& Libs::GtkSetting<gboolean>("gtk-application-prefer-dark-theme")) {
|
||||
@@ -897,6 +898,14 @@ bool AutostartSupported() {
|
||||
return !InSnap();
|
||||
}
|
||||
|
||||
bool TrayIconSupported() {
|
||||
return IsTrayIconSupported;
|
||||
}
|
||||
|
||||
void SetTrayIconSupported(bool supported) {
|
||||
IsTrayIconSupported = supported;
|
||||
}
|
||||
|
||||
void FallbackFontConfigCheckBegin() {
|
||||
if (!CheckFontConfigCrash()) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user