2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-18 14:00:09 +00:00

Add 'respect system dark mode' checkbox.

This commit is contained in:
John Preston
2020-07-22 16:10:17 +04:00
parent c24da4c3df
commit 8c4e8212cd
26 changed files with 298 additions and 151 deletions

View File

@@ -426,7 +426,7 @@ void MainWindow::initHook() {
|| QSystemTrayIcon::isSystemTrayAvailable();
LOG(("System tray available: %1").arg(Logs::b(trayAvailable)));
cSetSupportTray(trayAvailable);
Platform::SetTrayIconSupported(trayAvailable);
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
auto sniWatcher = new QDBusServiceWatcher(
@@ -591,9 +591,9 @@ void MainWindow::onSNIOwnerChanged(
const auto trayAvailable = SNIAvailable
|| QSystemTrayIcon::isSystemTrayAvailable();
cSetSupportTray(trayAvailable);
Platform::SetTrayIconSupported(trayAvailable);
if (cSupportTray()) {
if (trayAvailable) {
psSetupTrayIcon();
} else {
LOG(("System tray is not available."));
@@ -654,9 +654,9 @@ void MainWindow::psSetupTrayIcon() {
}
void MainWindow::workmodeUpdated(DBIWorkMode mode) {
if (!cSupportTray()) return;
if (mode == dbiwmWindowOnly) {
if (!Platform::TrayIconSupported()) {
return;
} else if (mode == dbiwmWindowOnly) {
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
if (_sniTrayIcon) {
_sniTrayIcon->setContextMenu(0);