Skip to content

Commit

Permalink
Version 0.10.13.alpha: removed Reply button for hidden text notifies.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Oct 7, 2016
1 parent b298c72 commit 6798b86
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Telegram/SourceFiles/window/notifications_manager_default.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -675,6 +675,9 @@ void Notification::updateNotifyDisplay() {
}

_cache = App::pixmapFromImageInPlace(std_::move(img));
if (!canReply()) {
toggleActionButtons(false);
}
update();
}

Expand All @@ -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) {
Expand All @@ -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);
Expand Down Expand Up @@ -776,7 +784,7 @@ void Notification::enterEvent(QEvent *e) {
if (auto manager = ManagerInstance.data()) {
manager->stopAllHiding();
}
if (!_replyArea) {
if (!_replyArea && canReply()) {
toggleActionButtons(true);
}
}
Expand Down
2 changes: 2 additions & 0 deletions Telegram/SourceFiles/window/notifications_manager_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ private slots:
void onReplyCancel();

private:
bool canReply() const;

void unlinkHistoryInManager();
void toggleActionButtons(bool visible);
void prepareActionsCache();
Expand Down

0 comments on commit 6798b86

Please sign in to comment.