Fix glitches in search results.

This commit is contained in:
John Preston 2022-12-06 20:32:58 +04:00
parent 6abfdd20fa
commit a8106aa38d
4 changed files with 15 additions and 3 deletions

View file

@ -637,6 +637,7 @@ auto ChooseTopicBoxController::Row::generatePaintUserpicCallback(
p.translate(x, y);
_topic->paintUserpic(p, view, {
.st = &st::forumTopicRow,
.currentBg = st::windowBg,
.now = crl::now(),
.width = outerWidth,
.paused = false,

View file

@ -778,6 +778,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
: _peerSearchSelected));
paintPeerSearchResult(p, result.get(), {
.st = &st::defaultDialogRow,
.currentBg = currentBg(),
.now = ms,
.width = fullWidth,
.active = active,
@ -792,6 +793,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
if (_searchInChat || _searchFromPeer) {
paintSearchInChat(p, {
.st = &st::forumTopicRow,
.currentBg = currentBg(),
.now = ms,
.width = fullWidth,
.paused = videoPaused,
@ -848,6 +850,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
.st = _st,
.folder = _openedFolder,
.forum = _openedForum,
.currentBg = currentBg(),
.filter = _filterId,
.now = ms,
.width = fullWidth,

View file

@ -799,6 +799,13 @@ void PaintUnreadBadge(QPainter &p, const QRect &rect, const UnreadBadgeStyle &st
} // namespace
const style::icon *ChatTypeIcon(not_null<PeerData*> peer) {
return ChatTypeIcon(peer, {
.st = &st::defaultDialogRow,
.currentBg = st::windowBg,
});
}
const style::icon *ChatTypeIcon(
not_null<PeerData*> peer,
const PaintContext &context) {

View file

@ -57,7 +57,7 @@ struct PaintContext {
TopicJumpCache *topicJumpCache = nullptr;
Data::Folder *folder = nullptr;
Data::Forum *forum = nullptr;
QBrush currentBg;
required<QBrush> currentBg;
FilterId filter = 0;
float64 topicsExpanded = 0.;
crl::time now = 0;
@ -71,9 +71,10 @@ struct PaintContext {
bool displayUnreadInfo = false;
};
const style::icon *ChatTypeIcon(
[[nodiscard]] const style::icon *ChatTypeIcon(
not_null<PeerData*> peer,
const PaintContext &context = { .st = &st::defaultDialogRow });
const PaintContext &context);
[[nodiscard]] const style::icon *ChatTypeIcon(not_null<PeerData*> peer);
class RowPainter {
public: