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

Method LayerWidget

Telegram/SourceFiles/editor/editor_layer_widget.cpp:52–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50} // namespace
51
52LayerWidget::LayerWidget(
53 not_null<QWidget*> parent,
54 base::unique_qptr<Ui::RpWidget> content)
55: Ui::LayerWidget(parent)
56, _content(std::move(content))
57, _backgroundTimer([=] { checkCacheBackground(); }) {
58 _content->setParent(this);
59 _content->show();
60
61 paintRequest(
62 ) | rpl::on_next([=](const QRect &clip) {
63 auto p = QPainter(this);
64 const auto faded = _backgroundFade.value(1.);
65 if (faded < 1.) {
66 p.drawImage(rect(), _backgroundBack);
67 if (faded > 0.) {
68 p.setOpacity(faded);
69 p.drawImage(rect(), _background);
70 }
71 } else {
72 p.drawImage(rect(), _background);
73 }
74 }, lifetime());
75}
76
77bool LayerWidget::eventHook(QEvent *e) {
78 return RpWidget::eventHook(e);

Callers

nothing calls this directly

Calls 4

QPainterClass · 0.50
showMethod · 0.45
valueMethod · 0.45
setOpacityMethod · 0.45

Tested by

no test coverage detected