mirror of https://github.com/procxx/kepka.git
parent
e6c0f0f774
commit
8c3b7f6417
|
@ -779,15 +779,22 @@ void MainWindow::toggleTray(QSystemTrayIcon::ActivationReason reason) {
|
||||||
if (reason == QSystemTrayIcon::Context) {
|
if (reason == QSystemTrayIcon::Context) {
|
||||||
updateTrayMenu(true);
|
updateTrayMenu(true);
|
||||||
QTimer::singleShot(1, this, SLOT(psShowTrayMenu()));
|
QTimer::singleShot(1, this, SLOT(psShowTrayMenu()));
|
||||||
} else {
|
} else if (!skipTrayClick()) {
|
||||||
if (isActive()) {
|
if (isActive()) {
|
||||||
minimizeToTray();
|
minimizeToTray();
|
||||||
} else {
|
} else {
|
||||||
showFromTray(reason);
|
showFromTray(reason);
|
||||||
}
|
}
|
||||||
|
_lastTrayClickTime = getms();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MainWindow::skipTrayClick() const {
|
||||||
|
return (_lastTrayClickTime > 0)
|
||||||
|
&& (getms() - _lastTrayClickTime
|
||||||
|
< QApplication::doubleClickInterval());
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::toggleDisplayNotifyFromTray() {
|
void MainWindow::toggleDisplayNotifyFromTray() {
|
||||||
if (App::passcoded()) {
|
if (App::passcoded()) {
|
||||||
if (!isActive()) showFromTray();
|
if (!isActive()) showFromTray();
|
||||||
|
|
|
@ -177,6 +177,8 @@ private:
|
||||||
void showConnecting(const QString &text, const QString &reconnect = QString());
|
void showConnecting(const QString &text, const QString &reconnect = QString());
|
||||||
void hideConnecting();
|
void hideConnecting();
|
||||||
|
|
||||||
|
[[nodiscard]] bool skipTrayClick() const;
|
||||||
|
|
||||||
void ensureLayerCreated();
|
void ensureLayerCreated();
|
||||||
void destroyLayerDelayed();
|
void destroyLayerDelayed();
|
||||||
|
|
||||||
|
@ -196,6 +198,7 @@ private:
|
||||||
};
|
};
|
||||||
QList<DelayedServiceMsg> _delayedServiceMsgs;
|
QList<DelayedServiceMsg> _delayedServiceMsgs;
|
||||||
mtpRequestId _serviceHistoryRequest = 0;
|
mtpRequestId _serviceHistoryRequest = 0;
|
||||||
|
TimeMs _lastTrayClickTime = 0;
|
||||||
|
|
||||||
object_ptr<PasscodeWidget> _passcode = { nullptr };
|
object_ptr<PasscodeWidget> _passcode = { nullptr };
|
||||||
object_ptr<Intro::Widget> _intro = { nullptr };
|
object_ptr<Intro::Widget> _intro = { nullptr };
|
||||||
|
|
Loading…
Reference in New Issue