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); p.translate(x, y);
_topic->paintUserpic(p, view, { _topic->paintUserpic(p, view, {
.st = &st::forumTopicRow, .st = &st::forumTopicRow,
.currentBg = st::windowBg,
.now = crl::now(), .now = crl::now(),
.width = outerWidth, .width = outerWidth,
.paused = false, .paused = false,

View file

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

View file

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

View file

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