1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2024-10-28 08:49:35 +01:00

systemtray: remove option to minimize in systray if tray not visible

Change-Id: I56ad4a55bda8a26931d81d6dbe903c41c65ba345
GitLab: #391
This commit is contained in:
Sébastien Blin 2023-05-29 14:27:29 -04:00
parent f7bc95d47e
commit 316750ad93
4 changed files with 12 additions and 2 deletions

View file

@ -34,7 +34,7 @@ extern const QString defaultDownloadPath;
// clang-format off
#define KEYS \
X(MinimizeOnClose, true) \
X(MinimizeOnClose, false) \
X(DownloadPath, defaultDownloadPath) \
X(ScreenshotPath, {}) \
X(EnableNotifications, true) \

View file

@ -83,7 +83,8 @@ SettingsPageBase {
id: closeOrMinCheckBox
Layout.fillWidth: true
checked: UtilsAdapter.getAppValue(Settings.MinimizeOnClose)
visible: UtilsAdapter.isSystemTrayIconVisible()
checked: UtilsAdapter.getAppValue(Settings.MinimizeOnClose) && UtilsAdapter.isSystemTrayIconVisible()
labelText: JamiStrings.keepMinimized
onSwitchToggled: UtilsAdapter.setAppValue(Settings.Key.MinimizeOnClose, checked)
}

View file

@ -802,3 +802,11 @@ UtilsAdapter::isRTL()
pref == "SYSTEM" ? QLocale::system().name() : pref;
return pref == "ar" || pref == "he" || pref == "fa" || pref == "ur";
}
bool
UtilsAdapter::isSystemTrayIconVisible()
{
if (!systemTray_)
return false;
return systemTray_->geometry() != QRect();
}

View file

@ -150,6 +150,7 @@ public:
Q_INVOKABLE QVariantMap getVideoPlayer(const QString& resource, const QString& bgColor);
Q_INVOKABLE bool isRTL();
Q_INVOKABLE bool isSystemTrayIconVisible();
Q_SIGNALS:
void debugMessageReceived(const QString& message);