diff --git a/Telegram/SourceFiles/window/notifications_manager_default.cpp b/Telegram/SourceFiles/window/notifications_manager_default.cpp index e1b3f18166..6dda3e38eb 100644 --- a/Telegram/SourceFiles/window/notifications_manager_default.cpp +++ b/Telegram/SourceFiles/window/notifications_manager_default.cpp @@ -615,10 +615,10 @@ void Notification::updateNotifyDisplay() { { Painter p(&img); - p.fillRect(0, 0, w - st::notifyBorderWidth, st::notifyBorderWidth, st::notifyBorder->b); - p.fillRect(w - st::notifyBorderWidth, 0, st::notifyBorderWidth, h - st::notifyBorderWidth, st::notifyBorder->b); - p.fillRect(st::notifyBorderWidth, h - st::notifyBorderWidth, w - st::notifyBorderWidth, st::notifyBorderWidth, st::notifyBorder->b); - p.fillRect(0, st::notifyBorderWidth, st::notifyBorderWidth, h - st::notifyBorderWidth, st::notifyBorder->b); + p.fillRect(0, 0, w - st::notifyBorderWidth, st::notifyBorderWidth, st::notifyBorder); + p.fillRect(w - st::notifyBorderWidth, 0, st::notifyBorderWidth, h - st::notifyBorderWidth, st::notifyBorder); + p.fillRect(st::notifyBorderWidth, h - st::notifyBorderWidth, w - st::notifyBorderWidth, st::notifyBorderWidth, st::notifyBorder); + p.fillRect(0, st::notifyBorderWidth, st::notifyBorderWidth, h - st::notifyBorderWidth, st::notifyBorder); if (!App::passcoded() && Global::NotifyView() <= dbinvShowName) { _history->peer->loadUserpic(true, true); @@ -675,6 +675,9 @@ void Notification::updateNotifyDisplay() { } _cache = App::pixmapFromImageInPlace(std_::move(img)); + if (!canReply()) { + toggleActionButtons(false); + } update(); } @@ -690,6 +693,7 @@ void Notification::updatePeerPhoto() { _peer->paintUserpicLeft(p, st::notifyPhotoSize, st::notifyPhotoPos.x(), st::notifyPhotoPos.y(), width()); } _cache = App::pixmapFromImageInPlace(std_::move(img)); + update(); } void Notification::itemRemoved(HistoryItem *deleted) { @@ -699,6 +703,10 @@ void Notification::itemRemoved(HistoryItem *deleted) { } } +bool Notification::canReply() const { + return (_item != nullptr) && !App::passcoded() && (Global::NotifyView() <= dbinvShowPreview); +} + void Notification::unlinkHistoryInManager() { if (auto manager = ManagerInstance.data()) { manager->unlinkFromShown(this); @@ -776,7 +784,7 @@ void Notification::enterEvent(QEvent *e) { if (auto manager = ManagerInstance.data()) { manager->stopAllHiding(); } - if (!_replyArea) { + if (!_replyArea && canReply()) { toggleActionButtons(true); } } diff --git a/Telegram/SourceFiles/window/notifications_manager_default.h b/Telegram/SourceFiles/window/notifications_manager_default.h index 1a2dbd069e..80a67acc41 100644 --- a/Telegram/SourceFiles/window/notifications_manager_default.h +++ b/Telegram/SourceFiles/window/notifications_manager_default.h @@ -216,6 +216,8 @@ private slots: void onReplyCancel(); private: + bool canReply() const; + void unlinkHistoryInManager(); void toggleActionButtons(bool visible); void prepareActionsCache();