mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Add invite link QR code generation.
This commit is contained in:
@@ -32,24 +32,6 @@ namespace Intro {
|
||||
namespace details {
|
||||
namespace {
|
||||
|
||||
[[nodiscard]] QImage TelegramLogoImage() {
|
||||
const auto size = QSize(st::introQrCenterSize, st::introQrCenterSize);
|
||||
auto result = QImage(
|
||||
size * style::DevicePixelRatio(),
|
||||
QImage::Format_ARGB32_Premultiplied);
|
||||
result.fill(Qt::transparent);
|
||||
result.setDevicePixelRatio(style::DevicePixelRatio());
|
||||
{
|
||||
auto p = QPainter(&result);
|
||||
auto hq = PainterHighQualityEnabler(p);
|
||||
p.setBrush(st::activeButtonBg);
|
||||
p.setPen(Qt::NoPen);
|
||||
p.drawEllipse(QRect(QPoint(), size));
|
||||
st::introQrPlane.paintInCenter(p, QRect(QPoint(), size));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
[[nodiscard]] QImage TelegramQrExact(const Qr::Data &data, int pixel) {
|
||||
return Qr::Generate(data, pixel, st::windowFg->c);
|
||||
}
|
||||
@@ -430,5 +412,23 @@ void QrWidget::cancelled() {
|
||||
api().request(base::take(_requestId)).cancel();
|
||||
}
|
||||
|
||||
QImage TelegramLogoImage() {
|
||||
const auto size = QSize(st::introQrCenterSize, st::introQrCenterSize);
|
||||
auto result = QImage(
|
||||
size * style::DevicePixelRatio(),
|
||||
QImage::Format_ARGB32_Premultiplied);
|
||||
result.fill(Qt::transparent);
|
||||
result.setDevicePixelRatio(style::DevicePixelRatio());
|
||||
{
|
||||
auto p = QPainter(&result);
|
||||
auto hq = PainterHighQualityEnabler(p);
|
||||
p.setBrush(st::activeButtonBg);
|
||||
p.setPen(Qt::NoPen);
|
||||
p.drawEllipse(QRect(QPoint(), size));
|
||||
st::introQrPlane.paintInCenter(p, QRect(QPoint(), size));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace details
|
||||
} // namespace Intro
|
||||
|
@@ -59,5 +59,7 @@ private:
|
||||
|
||||
};
|
||||
|
||||
[[nodiscard]] QImage TelegramLogoImage();
|
||||
|
||||
} // namespace details
|
||||
} // namespace Intro
|
||||
|
Reference in New Issue
Block a user