mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-03 21:54:05 +02:00
Fixed display of top bar suggestion while display filtered dialogs.
This commit is contained in:
parent
3ed6d1dec1
commit
9b2b8b6796
2 changed files with 13 additions and 2 deletions
|
@ -1035,10 +1035,17 @@ void Widget::setupTopBarSuggestions(not_null<Ui::VerticalLayout*> dialogs) {
|
|||
_openedFolderOrForumChanges.events_starting_with(false),
|
||||
widthValue() | rpl::map(
|
||||
_1 >= st::columnMinimalWidthLeft
|
||||
) | rpl::distinct_until_changed()
|
||||
) | rpl::map([=](FilterId id, bool folderOrForum, bool wide) {
|
||||
) | rpl::distinct_until_changed(),
|
||||
_searchStateForTopBarSuggestion.events_starting_with(
|
||||
!_searchState.query.isEmpty())
|
||||
) | rpl::map([=](
|
||||
FilterId id,
|
||||
bool folderOrForum,
|
||||
bool wide,
|
||||
bool search) {
|
||||
return !folderOrForum
|
||||
&& wide
|
||||
&& !search
|
||||
&& (id == session->data().chatsFilters().defaultId());
|
||||
});
|
||||
return TopBarSuggestionValue(dialogs, session, std::move(on));
|
||||
|
@ -3482,6 +3489,9 @@ bool Widget::applySearchState(SearchState state) {
|
|||
&& !_openedForum);
|
||||
updateControlsGeometry();
|
||||
}
|
||||
if (_topBarSuggestion && queryEmptyChanged) {
|
||||
_searchStateForTopBarSuggestion.fire(!_searchState.query.isEmpty());
|
||||
}
|
||||
_searchWithPostsPreview = computeSearchWithPostsPreview();
|
||||
if (queryChanged) {
|
||||
updateLockUnlockVisibility(anim::type::normal);
|
||||
|
|
|
@ -331,6 +331,7 @@ private:
|
|||
|
||||
Ui::SlideWrap<Ui::RpWidget> *_topBarSuggestion = nullptr;
|
||||
rpl::event_stream<int> _topBarSuggestionHeightChanged;
|
||||
rpl::event_stream<bool> _searchStateForTopBarSuggestion;
|
||||
rpl::event_stream<bool> _openedFolderOrForumChanges;
|
||||
|
||||
object_ptr<Ui::ElasticScroll> _scroll;
|
||||
|
|
Loading…
Add table
Reference in a new issue