mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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);
|
p.translate(0, (_previewResults.size() - to) * _st->height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_searchResults.empty()) {
|
if (!_searchResults.empty()) {
|
||||||
const auto text = showUnreadInSearchResults
|
const auto text = showUnreadInSearchResults
|
||||||
? u"Search results"_q
|
? u"Search results"_q
|
||||||
|
@ -1215,7 +1216,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
|
||||||
const auto filterFont = filterOver
|
const auto filterFont = filterOver
|
||||||
? st::searchedBarFont->underline()
|
? st::searchedBarFont->underline()
|
||||||
: st::searchedBarFont;
|
: st::searchedBarFont;
|
||||||
if (_searchState.tab == ChatSearchTab::MyMessages) {
|
if (hasChatTypeFilter()) {
|
||||||
const auto text = ChatTypeFilterLabel(_searchState.filter);
|
const auto text = ChatTypeFilterLabel(_searchState.filter);
|
||||||
if (!_chatTypeFilterWidth) {
|
if (!_chatTypeFilterWidth) {
|
||||||
_chatTypeFilterWidth = filterFont->width(text);
|
_chatTypeFilterWidth = filterFont->width(text);
|
||||||
|
@ -1747,7 +1748,7 @@ void InnerWidget::selectByMouse(QPoint globalPosition) {
|
||||||
}
|
}
|
||||||
auto selectedChatTypeFilter = false;
|
auto selectedChatTypeFilter = false;
|
||||||
const auto from = skip - st::searchedBarHeight;
|
const auto from = skip - st::searchedBarHeight;
|
||||||
if (mouseY <= skip && mouseY >= from) {
|
if (hasChatTypeFilter() && mouseY <= skip && mouseY >= from) {
|
||||||
const auto left = width()
|
const auto left = width()
|
||||||
- _chatTypeFilterWidth
|
- _chatTypeFilterWidth
|
||||||
- 2 * st::searchedBarPosition.x();
|
- 2 * st::searchedBarPosition.x();
|
||||||
|
@ -2998,6 +2999,11 @@ void InnerWidget::dragPinnedFromTouch() {
|
||||||
updateReorderPinned(now);
|
updateReorderPinned(now);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool InnerWidget::hasChatTypeFilter() const {
|
||||||
|
return !_searchResults.empty()
|
||||||
|
&& (_searchState.tab == ChatSearchTab::MyMessages);
|
||||||
|
}
|
||||||
|
|
||||||
void InnerWidget::searchRequested(bool loading) {
|
void InnerWidget::searchRequested(bool loading) {
|
||||||
_searchWaiting = false;
|
_searchWaiting = false;
|
||||||
_searchLoading = loading;
|
_searchLoading = loading;
|
||||||
|
|
|
@ -461,6 +461,7 @@ private:
|
||||||
void handleChatListEntryRefreshes();
|
void handleChatListEntryRefreshes();
|
||||||
void moveSearchIn();
|
void moveSearchIn();
|
||||||
void dragPinnedFromTouch();
|
void dragPinnedFromTouch();
|
||||||
|
[[nodiscard]] bool hasChatTypeFilter() const;
|
||||||
|
|
||||||
void saveChatsFilterScrollState(FilterId filterId);
|
void saveChatsFilterScrollState(FilterId filterId);
|
||||||
void restoreChatsFilterScrollState(FilterId filterId);
|
void restoreChatsFilterScrollState(FilterId filterId);
|
||||||
|
|
Loading…
Add table
Reference in a new issue