| 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) |