ZaStoGram_desktop/Telegram/SourceFiles/wallet/wallet_card_gradient.h
John Preston c75cfebc55 Turn Gram cards only by visible steps, not by a swipe
Task: 2026/10/02/turn-gram-cards-only-by-visible-angle-steps
2026-10-08 22:24:48 +04:00

37 lines
816 B
C++

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include <QtCore/QRect>
#include <QtGui/QImage>
class QPainter;
namespace Wallet {
class CardBackground final {
public:
// Degrees clockwise; one render serves every card it has drawn since.
void paint(QPainter &p, const QRect &card, float64 angle);
void clear();
private:
QImage _image;
QImage _field;
QSize _drawn;
float64 _angle = 0.;
int _ratio = 0;
};
void PaintCardQrPlate(QPainter &p, const QRect &plate);
// The sweep's average, the colour surfaces next to the card match.
[[nodiscard]] QColor CardReferenceColor();
} // namespace Wallet