mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Don't mark messages as read when screen is locked.
This commit is contained in:
parent
da1168fb00
commit
819ce06dfb
12 changed files with 79 additions and 23 deletions
|
@ -208,6 +208,55 @@ callRemoteAudioMute: FlatLabel(callStatus) {
|
||||||
}
|
}
|
||||||
callRemoteAudioMuteSkip: 12px;
|
callRemoteAudioMuteSkip: 12px;
|
||||||
|
|
||||||
|
callMuteMainBlobMinRadius: 57px;
|
||||||
|
callMuteMainBlobMaxRadius: 63px;
|
||||||
|
callMuteMinorBlobMinRadius: 64px;
|
||||||
|
callMuteMinorBlobMaxRadius: 74px;
|
||||||
|
callMuteMajorBlobMinRadius: 67px;
|
||||||
|
callMuteMajorBlobMaxRadius: 77px;
|
||||||
|
|
||||||
|
callMuteButtonActiveInner: IconButton {
|
||||||
|
width: 136px;
|
||||||
|
height: 165px;
|
||||||
|
}
|
||||||
|
callMuteButtonLabel: FlatLabel(defaultFlatLabel) {
|
||||||
|
textFg: groupCallMembersFg;
|
||||||
|
style: TextStyle(defaultTextStyle) {
|
||||||
|
font: font(14px);
|
||||||
|
linkFont: font(14px);
|
||||||
|
linkFontOver: font(14px underline);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
callMuteButtonSublabel: FlatLabel(defaultFlatLabel) {
|
||||||
|
textFg: groupCallMemberNotJoinedStatus;
|
||||||
|
}
|
||||||
|
callMuteButtonLabelsSkip: 5px;
|
||||||
|
callMuteButtonSublabelSkip: 19px;
|
||||||
|
callMuteButtonActive: CallButton {
|
||||||
|
button: callMuteButtonActiveInner;
|
||||||
|
bg: groupCallLive1;
|
||||||
|
bgSize: 100px;
|
||||||
|
bgPosition: point(18px, 18px);
|
||||||
|
outerRadius: 18px;
|
||||||
|
outerBg: callAnswerBgOuter;
|
||||||
|
label: callMuteButtonLabel;
|
||||||
|
}
|
||||||
|
callMuteButtonMuted: CallButton(callMuteButtonActive) {
|
||||||
|
bg: groupCallMuted1;
|
||||||
|
label: callMuteButtonLabel;
|
||||||
|
}
|
||||||
|
callMuteButtonConnecting: CallButton(callMuteButtonMuted) {
|
||||||
|
bg: callIconBg;
|
||||||
|
label: callMuteButtonLabel;
|
||||||
|
}
|
||||||
|
callMuteButtonLabelAdditional: 5px;
|
||||||
|
|
||||||
|
callConnectingRadial: InfiniteRadialAnimation(defaultInfiniteRadialAnimation) {
|
||||||
|
color: lightButtonFg;
|
||||||
|
thickness: 4px;
|
||||||
|
size: size(100px, 100px);
|
||||||
|
}
|
||||||
|
|
||||||
callBarHeight: 38px;
|
callBarHeight: 38px;
|
||||||
callBarMuteToggle: IconButton {
|
callBarMuteToggle: IconButton {
|
||||||
width: 41px;
|
width: 41px;
|
||||||
|
|
|
@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
#include "main/main_app_config.h"
|
#include "main/main_app_config.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "facades.h" // Global::ScreenIsLocked.
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -112,6 +113,10 @@ void UiIntegration::activationFromTopPanel() {
|
||||||
Platform::IgnoreApplicationActivationRightNow();
|
Platform::IgnoreApplicationActivationRightNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UiIntegration::screenIsLocked() {
|
||||||
|
return Global::ScreenIsLocked();
|
||||||
|
}
|
||||||
|
|
||||||
QString UiIntegration::timeFormat() {
|
QString UiIntegration::timeFormat() {
|
||||||
return cTimeFormat();
|
return cTimeFormat();
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ public:
|
||||||
void textActionsUpdated() override;
|
void textActionsUpdated() override;
|
||||||
void activationFromTopPanel() override;
|
void activationFromTopPanel() override;
|
||||||
|
|
||||||
|
bool screenIsLocked() override;
|
||||||
QString timeFormat() override;
|
QString timeFormat() override;
|
||||||
|
|
||||||
std::shared_ptr<ClickHandler> createLinkHandler(
|
std::shared_ptr<ClickHandler> createLinkHandler(
|
||||||
|
|
|
@ -727,6 +727,10 @@ bool SkipFlashBounce() {
|
||||||
return Inhibited();
|
return Inhibited();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HideDetails() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool Supported() {
|
bool Supported() {
|
||||||
return ServiceRegistered;
|
return ServiceRegistered;
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,6 +159,10 @@ bool SkipFlashBounce() {
|
||||||
return SkipAudio();
|
return SkipAudio();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HideDetails() {
|
||||||
|
return Global::ScreenIsLocked();
|
||||||
|
}
|
||||||
|
|
||||||
bool Supported() {
|
bool Supported() {
|
||||||
return Platform::IsMac10_8OrGreater();
|
return Platform::IsMac10_8OrGreater();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ namespace Notifications {
|
||||||
[[nodiscard]] bool SkipAudio();
|
[[nodiscard]] bool SkipAudio();
|
||||||
[[nodiscard]] bool SkipToast();
|
[[nodiscard]] bool SkipToast();
|
||||||
[[nodiscard]] bool SkipFlashBounce();
|
[[nodiscard]] bool SkipFlashBounce();
|
||||||
|
[[nodiscard]] bool HideDetails();
|
||||||
|
|
||||||
[[nodiscard]] bool Supported();
|
[[nodiscard]] bool Supported();
|
||||||
[[nodiscard]] bool Enforced();
|
[[nodiscard]] bool Enforced();
|
||||||
|
|
|
@ -19,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "core/core_settings.h"
|
#include "core/core_settings.h"
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "facades.h" // Global::ScreenIsLocked.
|
||||||
#include "windows_quiethours_h.h"
|
#include "windows_quiethours_h.h"
|
||||||
|
|
||||||
#include <Shobjidl.h>
|
#include <Shobjidl.h>
|
||||||
|
@ -798,14 +799,10 @@ bool SkipAudio() {
|
||||||
if (UserNotificationState == QUNS_NOT_PRESENT
|
if (UserNotificationState == QUNS_NOT_PRESENT
|
||||||
|| UserNotificationState == QUNS_PRESENTATION_MODE
|
|| UserNotificationState == QUNS_PRESENTATION_MODE
|
||||||
|| QuietHoursEnabled
|
|| QuietHoursEnabled
|
||||||
|| FocusAssistBlocks) {
|
|| FocusAssistBlocks
|
||||||
|
|| Global::ScreenIsLocked()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (const auto filter = EventFilter::GetInstance()) {
|
|
||||||
if (filter->sessionLoggedOff()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -826,5 +823,9 @@ bool SkipFlashBounce() {
|
||||||
return SkipToast();
|
return SkipToast();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HideDetails() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Notifications
|
} // namespace Notifications
|
||||||
} // namespace Platform
|
} // namespace Platform
|
||||||
|
|
|
@ -93,10 +93,6 @@ EventFilter *EventFilter::CreateInstance(not_null<MainWindow*> window) {
|
||||||
return (instance = new EventFilter(window));
|
return (instance = new EventFilter(window));
|
||||||
}
|
}
|
||||||
|
|
||||||
EventFilter *EventFilter::GetInstance() {
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EventFilter::Destroy() {
|
void EventFilter::Destroy() {
|
||||||
Expects(instance != nullptr);
|
Expects(instance != nullptr);
|
||||||
|
|
||||||
|
@ -240,9 +236,9 @@ bool EventFilter::mainWindowEvent(
|
||||||
|
|
||||||
case WM_WTSSESSION_CHANGE: {
|
case WM_WTSSESSION_CHANGE: {
|
||||||
if (wParam == WTS_SESSION_LOGOFF || wParam == WTS_SESSION_LOCK) {
|
if (wParam == WTS_SESSION_LOGOFF || wParam == WTS_SESSION_LOCK) {
|
||||||
setSessionLoggedOff(true);
|
Global::SetScreenIsLocked(true);
|
||||||
} else if (wParam == WTS_SESSION_LOGON || wParam == WTS_SESSION_UNLOCK) {
|
} else if (wParam == WTS_SESSION_LOGON || wParam == WTS_SESSION_UNLOCK) {
|
||||||
setSessionLoggedOff(false);
|
Global::SetScreenIsLocked(false);
|
||||||
}
|
}
|
||||||
} return false;
|
} return false;
|
||||||
|
|
||||||
|
|
|
@ -20,15 +20,7 @@ public:
|
||||||
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
|
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
|
||||||
bool mainWindowEvent(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *result);
|
bool mainWindowEvent(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *result);
|
||||||
|
|
||||||
bool sessionLoggedOff() const {
|
|
||||||
return _sessionLoggedOff;
|
|
||||||
}
|
|
||||||
void setSessionLoggedOff(bool loggedOff) {
|
|
||||||
_sessionLoggedOff = loggedOff;
|
|
||||||
}
|
|
||||||
|
|
||||||
static EventFilter *CreateInstance(not_null<MainWindow*> window);
|
static EventFilter *CreateInstance(not_null<MainWindow*> window);
|
||||||
static EventFilter *GetInstance();
|
|
||||||
static void Destroy();
|
static void Destroy();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -42,7 +34,6 @@ private:
|
||||||
LRESULT *result);
|
LRESULT *result);
|
||||||
|
|
||||||
not_null<MainWindow*> _window;
|
not_null<MainWindow*> _window;
|
||||||
bool _sessionLoggedOff = false;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,10 @@
|
||||||
#include "ui/effects/radial_animation.h"
|
#include "ui/effects/radial_animation.h"
|
||||||
#include "lottie/lottie_icon.h"
|
#include "lottie/lottie_icon.h"
|
||||||
|
|
||||||
|
namespace st {
|
||||||
|
extern const style::InfiniteRadialAnimation &callConnectingRadial;
|
||||||
|
} // namespace st
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
||||||
class BlobsWidget;
|
class BlobsWidget;
|
||||||
|
|
|
@ -578,7 +578,7 @@ void System::updateAll() {
|
||||||
|
|
||||||
Manager::DisplayOptions Manager::GetNotificationOptions(HistoryItem *item) {
|
Manager::DisplayOptions Manager::GetNotificationOptions(HistoryItem *item) {
|
||||||
const auto hideEverything = Core::App().passcodeLocked()
|
const auto hideEverything = Core::App().passcodeLocked()
|
||||||
|| Global::ScreenIsLocked();
|
|| Platform::Notifications::HideDetails();
|
||||||
|
|
||||||
const auto view = Core::App().settings().notifyView();
|
const auto view = Core::App().settings().notifyView();
|
||||||
DisplayOptions result;
|
DisplayOptions result;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit eb768c8c4b5bf09e6b6598728333fb99d65486e7
|
Subproject commit 14c67cf724a572186455a8c0639f037ae26cc762
|
Loading…
Add table
Reference in a new issue