mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-05 00:46:08 +00:00
Fix invisible chat type filter.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user