ZaStoGram_desktop/Telegram/SourceFiles/wallet/wallet_row_address_chips.h
John Preston c9e0fa604f Show wallet transaction addresses as monospace chips
Task: 2026/11/05/show-transaction-list-addresses-as-monospace-chips
2026-11-06 17:18:32 +04:00

53 lines
1.2 KiB
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
class Painter;
namespace Ui {
class RpWidget;
class VerticalLayout;
} // namespace Ui
namespace Wallet {
class AddressChips final {
public:
[[nodiscard]] static std::optional<AddressChips> FromAddress(
const QString &address);
void paintPlates(QPainter &p, QRect line) const;
void paintTexts(QPainter &p, QRect line) const;
void paint(QPainter &p, QRect line) const;
private:
explicit AddressChips(std::array<QString, 3> texts);
std::array<QString, 3> _texts;
};
[[nodiscard]] not_null<Ui::RpWidget*> AddHistoryRowTitle(
not_null<Ui::VerticalLayout*> container,
const QString &title,
const QString &address,
int lineHeight,
style::margins margins,
not_null<QWidget*> button,
Fn<void(Fn<void(Painter&)>)> paintUnderRipple);
void PaintSendingRowTitle(
QPainter &p,
QRect line,
const std::optional<AddressChips> &now,
const std::optional<AddressChips> *next,
bool same,
float64 progress,
Fn<void(bool next, float64 opacity)> text);
} // namespace Wallet