Version 0.10.13.alpha: removed Reply button for hidden text notifies.

This commit is contained in:
John Preston 2016-10-07 20:02:13 +03:00
parent b298c72b52
commit 6798b86655
2 changed files with 15 additions and 5 deletions

View File

@ -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);
}
}

View File

@ -216,6 +216,8 @@ private slots:
void onReplyCancel();
private:
bool canReply() const;
void unlinkHistoryInManager();
void toggleActionButtons(bool visible);
void prepareActionsCache();