MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / PaintBackground

Method PaintBackground

Telegram/SourceFiles/window/section_widget.cpp:339–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339void SectionWidget::PaintBackground(
340 not_null<Window::SessionController*> controller,
341 not_null<Ui::ChatTheme*> theme,
342 not_null<QWidget*> widget,
343 QRect clip) {
344 if (const auto id = theme->background().giftId) {
345 const auto fillHeight = controller->content()->height();
346 const auto fill = QSize(widget->width(), fillHeight);
347 const auto &state = theme->backgroundState(fill);
348 const auto make = [&] {
349 return MakeWrappedEmoji<Ui::Text::LimitedLoopsEmoji>(
350 controller->session().data().customEmojiManager().create(
351 id,
352 crl::guard(widget, [=] { widget->update(); }),
353 Data::CustomEmojiSizeTag::Isolated),
354 1);
355 };
356 if (!state.was.gift) {
357 state.was.gift = make();
358 }
359 if (!state.now.gift) {
360 state.now.gift = make();
361 }
362 }
363
364 PaintBackground(
365 theme,
366 widget,
367 controller->content()->height(),
368 controller->content()->backgroundFromY(),
369 clip,
370 controller->isGifPausedAtLeastFor(GifPauseReason::Any));
371}
372
373void SectionWidget::PaintBackground(
374 not_null<Ui::ChatTheme*> theme,

Callers

nothing calls this directly

Calls 15

FrameSizeFromTagFunction · 0.85
backgroundFromYMethod · 0.80
isGifPausedAtLeastForMethod · 0.80
centerMethod · 0.80
rotateMethod · 0.80
QPainterClass · 0.50
backgroundMethod · 0.45
heightMethod · 0.45
contentMethod · 0.45
widthMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected