Un-focus chats search on empty history click.

This commit is contained in:
John Preston 2024-04-24 16:54:10 +04:00
parent 3da51b1bc9
commit e6d72b4861
2 changed files with 9 additions and 3 deletions

View File

@ -6552,6 +6552,14 @@ bool HistoryWidget::cornerButtonsHas(HistoryView::CornerButtonType type) {
}
void HistoryWidget::mousePressEvent(QMouseEvent *e) {
if (!_list) {
// Remove focus from the chats list search.
setFocus();
// Set it back to the chats list so that typing filter chats.
controller()->widget()->setInnerFocus();
return;
}
const auto isReadyToForward = readyToForward();
if (_inPhotoEdit && _photoEditMedia) {
EditCaptionBox::StartPhotoEdit(

View File

@ -1180,10 +1180,8 @@ void MainWidget::setInnerFocus() {
}
} else if (_mainSection) {
_mainSection->setInnerFocus();
} else if (_history->peer() || !_thirdSection) {
_history->setInnerFocus();
} else {
_thirdSection->setInnerFocus();
_history->setInnerFocus();
}
}