2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-04 00:25:17 +00:00

Update API scheme to layer 120.

This commit is contained in:
John Preston
2020-10-06 15:58:16 +03:00
parent eb27763cae
commit cc28ba4284
21 changed files with 113 additions and 105 deletions

View File

@@ -380,7 +380,7 @@ int InnerWidget::searchedOffset() const {
int InnerWidget::searchInChatSkip() const {
auto result = st::searchedBarHeight + st::dialogsSearchInHeight;
if (_searchFromUser) {
if (_searchFromPeer) {
result += st::lineWidth + st::dialogsSearchInHeight;
}
return result;
@@ -811,7 +811,7 @@ void InnerWidget::paintSearchInChat(Painter &p) const {
auto fullRect = QRect(0, top, width(), height - top);
p.fillRect(fullRect, st::dialogsBg);
if (_searchFromUser) {
if (_searchFromPeer) {
p.fillRect(QRect(0, top + st::dialogsSearchInHeight, width(), st::lineWidth), st::shadowFg);
}
@@ -829,7 +829,7 @@ void InnerWidget::paintSearchInChat(Painter &p) const {
} else {
Unexpected("Empty Key in paintSearchInChat.");
}
if (const auto from = _searchFromUser) {
if (const auto from = _searchFromPeer) {
top += st::dialogsSearchInHeight + st::lineWidth;
p.setPen(st::dialogsTextFg);
p.setTextPalette(st::dialogsSearchFromPalette);
@@ -1868,7 +1868,7 @@ void InnerWidget::applyFilterUpdate(QString newFilter, bool force) {
newFilter = words.isEmpty() ? QString() : words.join(' ');
if (newFilter != _filter || force) {
_filter = newFilter;
if (_filter.isEmpty() && !_searchFromUser) {
if (_filter.isEmpty() && !_searchFromPeer) {
clearFilter();
} else {
_state = WidgetState::Filtered;
@@ -2328,7 +2328,7 @@ bool InnerWidget::hasFilteredResults() const {
return !_filterResults.empty() && _hashtagResults.empty();
}
void InnerWidget::searchInChat(Key key, UserData *from) {
void InnerWidget::searchInChat(Key key, PeerData *from) {
_searchInMigrated = nullptr;
if (const auto peer = key.peer()) {
if (const auto migrateTo = peer->migrateTo()) {
@@ -2338,7 +2338,7 @@ void InnerWidget::searchInChat(Key key, UserData *from) {
}
}
_searchInChat = key;
_searchFromUser = from;
_searchFromPeer = from;
if (_searchInChat) {
_controller->closeFolder();
onHashtagFilterUpdate(QStringRef());
@@ -2347,9 +2347,9 @@ void InnerWidget::searchInChat(Key key, UserData *from) {
} else {
_cancelSearchInChat->hide();
}
if (_searchFromUser) {
if (_searchFromPeer) {
_cancelSearchFromUser->show();
_searchFromUserUserpic = _searchFromUser->createUserpicView();
_searchFromUserUserpic = _searchFromPeer->createUserpicView();
} else {
_cancelSearchFromUser->hide();
_searchFromUserUserpic = nullptr;
@@ -2386,7 +2386,7 @@ void InnerWidget::refreshSearchInChatLabel() {
dialog,
Ui::DialogTextOptions());
}
const auto from = _searchFromUser ? _searchFromUser->name : QString();
const auto from = _searchFromPeer ? _searchFromPeer->name : QString();
if (!from.isEmpty()) {
const auto fromUserText = tr::lng_dlg_search_from(
tr::now,