mirror of https://github.com/procxx/kepka.git
Improve saved messages search results display.
This commit is contained in:
parent
255dbf9405
commit
ec515080b5
|
@ -1797,7 +1797,7 @@ void DialogsInner::searchInPeer(PeerData *peer, UserData *from) {
|
||||||
_cancelSearchInPeer->show();
|
_cancelSearchInPeer->show();
|
||||||
if (_searchInPeer->isSelf()) {
|
if (_searchInPeer->isSelf()) {
|
||||||
_searchInSavedText.setText(
|
_searchInSavedText.setText(
|
||||||
st::dialogsSearchFromStyle,
|
st::msgNameStyle,
|
||||||
lang(lng_saved_messages),
|
lang(lng_saved_messages),
|
||||||
_textDlgOptions);
|
_textDlgOptions);
|
||||||
}
|
}
|
||||||
|
|
|
@ -499,7 +499,7 @@ void RowPainter::paint(
|
||||||
auto item = row->item();
|
auto item = row->item();
|
||||||
auto history = item->history();
|
auto history = item->history();
|
||||||
auto cloudDraft = nullptr;
|
auto cloudDraft = nullptr;
|
||||||
auto from = [&] {
|
const auto from = [&] {
|
||||||
if (auto searchPeer = row->searchInPeer()) {
|
if (auto searchPeer = row->searchInPeer()) {
|
||||||
if (searchPeer->isSelf()) {
|
if (searchPeer->isSelf()) {
|
||||||
return item->senderOriginal();
|
return item->senderOriginal();
|
||||||
|
@ -509,7 +509,7 @@ void RowPainter::paint(
|
||||||
}
|
}
|
||||||
return (history->peer->migrateTo() ? history->peer->migrateTo() : history->peer);
|
return (history->peer->migrateTo() ? history->peer->migrateTo() : history->peer);
|
||||||
}();
|
}();
|
||||||
auto drawInDialogWay = [&] {
|
const auto drawInDialogWay = [&] {
|
||||||
if (auto searchPeer = row->searchInPeer()) {
|
if (auto searchPeer = row->searchInPeer()) {
|
||||||
if (!searchPeer->isChannel() || searchPeer->isMegagroup()) {
|
if (!searchPeer->isChannel() || searchPeer->isMegagroup()) {
|
||||||
return HistoryItem::DrawInDialog::WithoutSender;
|
return HistoryItem::DrawInDialog::WithoutSender;
|
||||||
|
@ -517,7 +517,7 @@ void RowPainter::paint(
|
||||||
}
|
}
|
||||||
return HistoryItem::DrawInDialog::Normal;
|
return HistoryItem::DrawInDialog::Normal;
|
||||||
}();
|
}();
|
||||||
auto paintItemCallback = [&](int nameleft, int namewidth) {
|
const auto paintItemCallback = [&](int nameleft, int namewidth) {
|
||||||
auto lastWidth = namewidth;
|
auto lastWidth = namewidth;
|
||||||
auto texttop = st::dialogsPadding.y() + st::msgNameFont->height + st::dialogsSkip;
|
auto texttop = st::dialogsPadding.y() + st::msgNameFont->height + st::dialogsSkip;
|
||||||
item->drawInDialog(
|
item->drawInDialog(
|
||||||
|
@ -529,11 +529,14 @@ void RowPainter::paint(
|
||||||
row->_cacheFor,
|
row->_cacheFor,
|
||||||
row->_cache);
|
row->_cache);
|
||||||
};
|
};
|
||||||
auto paintCounterCallback = [] {};
|
const auto paintCounterCallback = [] {};
|
||||||
|
const auto showSavedMessages = history->peer->isSelf()
|
||||||
|
&& !row->searchInPeer();
|
||||||
const auto flags = (active ? Flag::Active : Flag(0))
|
const auto flags = (active ? Flag::Active : Flag(0))
|
||||||
| (selected ? Flag::Selected : Flag(0))
|
| (selected ? Flag::Selected : Flag(0))
|
||||||
| (onlyBackground ? Flag::OnlyBackground : Flag(0))
|
| (onlyBackground ? Flag::OnlyBackground : Flag(0))
|
||||||
| Flag::SearchResult;
|
| Flag::SearchResult
|
||||||
|
| (showSavedMessages ? Flag::SavedMessages : Flag(0));
|
||||||
paintRow(
|
paintRow(
|
||||||
p,
|
p,
|
||||||
row,
|
row,
|
||||||
|
|
Loading…
Reference in New Issue