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

Function MakeLinkCopyIcon

Telegram/SourceFiles/boxes/gift_premium_box.cpp:156–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156[[nodiscard]] object_ptr<Ui::RpWidget> MakeLinkCopyIcon(
157 not_null<QWidget*> parent) {
158 auto result = object_ptr<Ui::RpWidget>(parent);
159 const auto raw = result.data();
160
161 raw->paintRequest() | rpl::on_next([=] {
162 auto p = QPainter(raw);
163 const auto &icon = st::giveawayGiftCodeLinkCopy;
164 const auto left = (raw->width() - icon.width()) / 2;
165 const auto top = (raw->height() - icon.height()) / 2;
166 icon.paint(p, left, top, raw->width());
167 }, raw->lifetime());
168
169 raw->resize(
170 st::giveawayGiftCodeLinkCopyWidth,
171 st::giveawayGiftCodeLinkHeight);
172
173 raw->setAttribute(Qt::WA_TransparentForMouseEvents);
174
175 return result;
176}
177
178[[nodiscard]] tr::phrase<lngtag_count> GiftDurationPhrase(int days) {
179 return (days < 30)

Callers 1

GiftCodeBoxFunction · 0.85

Calls 6

resizeMethod · 0.80
QPainterClass · 0.50
dataMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45
paintMethod · 0.45

Tested by

no test coverage detected