Fixed ability to see empty header in HistoryWidget.

The problem occurs by pressing the left side of the header
when there is no second layer.
This commit is contained in:
23rd 2020-06-04 00:46:16 +03:00 committed by John Preston
parent 1c77b9c16f
commit f4042d5ad5

View file

@ -5530,7 +5530,15 @@ void HistoryWidget::updateUnreadMentionsVisibility() {
}
void HistoryWidget::mousePressEvent(QMouseEvent *e) {
_replyForwardPressed = QRect(0, _field->y() - st::historySendPadding - st::historyReplyHeight, st::historyReplySkip, st::historyReplyHeight).contains(e->pos());
const auto hasSecondLayer = (_editMsgId
|| _replyToId
|| readyToForward()
|| _kbReplyTo);
_replyForwardPressed = hasSecondLayer && QRect(
0,
_field->y() - st::historySendPadding - st::historyReplyHeight,
st::historyReplySkip,
st::historyReplyHeight).contains(e->pos());
if (_replyForwardPressed && !_fieldBarCancel->isHidden()) {
updateField();
} else if (_inReplyEditForward) {