Skip to content

Commit

Permalink
Fixed display of chats filters strip from dialogs widget in search mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Nov 7, 2024
1 parent 4a351ae commit 7a7e1b0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Telegram/SourceFiles/dialogs/dialogs_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3139,6 +3139,9 @@ bool Widget::applySearchState(SearchState state) {
const auto tagsChanged = (_searchState.tags != state.tags);
const auto queryChanged = (_searchState.query != state.query);
const auto tabChanged = (_searchState.tab != state.tab);
const auto queryEmptyChanged = queryChanged
? (_searchState.query.isEmpty() != state.query.isEmpty())
: false;

if (forum) {
if (_openedForum == forum) {
Expand Down Expand Up @@ -3174,6 +3177,10 @@ bool Widget::applySearchState(SearchState state) {
? peer->owner().history(migrateFrom).get()
: nullptr;
_searchState = state;
if (_chatFilters && queryEmptyChanged) {
_chatFilters->setVisible(_searchState.query.isEmpty());
updateControlsGeometry();
}
_searchWithPostsPreview = computeSearchWithPostsPreview();
if (queryChanged) {
updateLockUnlockVisibility(anim::type::normal);
Expand Down Expand Up @@ -3591,7 +3598,7 @@ void Widget::updateControlsGeometry() {
_chatFilters->move(0, chatFiltersTop);
}
const auto scrollTop = chatFiltersTop
+ (_chatFilters
+ ((_chatFilters && _searchState.query.isEmpty())
? (_chatFilters->height() * (1. - narrowRatio))
: 0);
const auto scrollHeight = height() - scrollTop - bottomSkip;
Expand Down

0 comments on commit 7a7e1b0

Please sign in to comment.