mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 05:07:10 +02:00
Fix invisible chat type filter.
This commit is contained in:
parent
9db2502cd0
commit
0523ae705a
2 changed files with 9 additions and 2 deletions
|
@ -1199,6 +1199,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
|
|||
p.translate(0, (_previewResults.size() - to) * _st->height);
|
||||
}
|
||||
}
|
||||
|
||||
if (!_searchResults.empty()) {
|
||||
const auto text = showUnreadInSearchResults
|
||||
? u"Search results"_q
|
||||
|
@ -1215,7 +1216,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
|
|||
const auto filterFont = filterOver
|
||||
? st::searchedBarFont->underline()
|
||||
: st::searchedBarFont;
|
||||
if (_searchState.tab == ChatSearchTab::MyMessages) {
|
||||
if (hasChatTypeFilter()) {
|
||||
const auto text = ChatTypeFilterLabel(_searchState.filter);
|
||||
if (!_chatTypeFilterWidth) {
|
||||
_chatTypeFilterWidth = filterFont->width(text);
|
||||
|
@ -1747,7 +1748,7 @@ void InnerWidget::selectByMouse(QPoint globalPosition) {
|
|||
}
|
||||
auto selectedChatTypeFilter = false;
|
||||
const auto from = skip - st::searchedBarHeight;
|
||||
if (mouseY <= skip && mouseY >= from) {
|
||||
if (hasChatTypeFilter() && mouseY <= skip && mouseY >= from) {
|
||||
const auto left = width()
|
||||
- _chatTypeFilterWidth
|
||||
- 2 * st::searchedBarPosition.x();
|
||||
|
@ -2998,6 +2999,11 @@ void InnerWidget::dragPinnedFromTouch() {
|
|||
updateReorderPinned(now);
|
||||
}
|
||||
|
||||
bool InnerWidget::hasChatTypeFilter() const {
|
||||
return !_searchResults.empty()
|
||||
&& (_searchState.tab == ChatSearchTab::MyMessages);
|
||||
}
|
||||
|
||||
void InnerWidget::searchRequested(bool loading) {
|
||||
_searchWaiting = false;
|
||||
_searchLoading = loading;
|
||||
|
|
|
@ -461,6 +461,7 @@ private:
|
|||
void handleChatListEntryRefreshes();
|
||||
void moveSearchIn();
|
||||
void dragPinnedFromTouch();
|
||||
[[nodiscard]] bool hasChatTypeFilter() const;
|
||||
|
||||
void saveChatsFilterScrollState(FilterId filterId);
|
||||
void restoreChatsFilterScrollState(FilterId filterId);
|
||||
|
|
Loading…
Add table
Reference in a new issue