Fixed display of chat filters strip while search in peer.

This commit is contained in:
23rd 2025-04-18 00:39:35 +03:00 committed by John Preston
parent 6704886c6e
commit b1c5c53687

View file

@ -3487,9 +3487,10 @@ bool Widget::applySearchState(SearchState state) {
? peer->owner().history(migrateFrom).get() ? peer->owner().history(migrateFrom).get()
: nullptr; : nullptr;
_searchState = state; _searchState = state;
if (_chatFilters && queryEmptyChanged) { if (_chatFilters && (queryEmptyChanged || inChatChanged)) {
_chatFilters->setVisible(_searchState.query.isEmpty() _chatFilters->setVisible(_searchState.query.isEmpty()
&& !_openedForum); && !_openedForum
&& !searchInPeer());
updateControlsGeometry(); updateControlsGeometry();
} }
if (_topBarSuggestion && queryEmptyChanged) { if (_topBarSuggestion && queryEmptyChanged) {
@ -3919,7 +3920,9 @@ void Widget::updateControlsGeometry() {
_chatFilters->move(0, chatFiltersTop); _chatFilters->move(0, chatFiltersTop);
} }
const auto scrollTop = chatFiltersTop const auto scrollTop = chatFiltersTop
+ ((_chatFilters && _searchState.query.isEmpty() && !_openedForum) + ((_chatFilters
&& _searchState.query.isEmpty()
&& !_openedForum && !searchInPeer())
? (_chatFilters->height() * (1. - narrowRatio)) ? (_chatFilters->height() * (1. - narrowRatio))
: 0); : 0);
const auto scrollHeight = height() - scrollTop - bottomSkip; const auto scrollHeight = height() - scrollTop - bottomSkip;