2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-25 19:57:20 +00:00
tdesktop/Telegram/SourceFiles/payments/ui/payments_reaction_box.h

63 lines
1.2 KiB
C
Raw Normal View History

2024-08-06 12:48:06 +02:00
/*
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 "base/object_ptr.h"
2025-02-21 21:29:10 +04:00
namespace style {
struct RoundCheckbox;
} // namespace style
2024-08-06 12:48:06 +02:00
namespace Ui {
class BoxContent;
class GenericBox;
class DynamicImage;
2024-08-06 12:48:06 +02:00
struct TextWithContext {
TextWithEntities text;
2025-03-07 14:17:39 +04:00
Text::MarkedContext context;
2024-08-06 12:48:06 +02:00
};
struct PaidReactionTop {
QString name;
std::shared_ptr<DynamicImage> photo;
2025-02-04 20:20:35 +04:00
uint64 barePeerId = 0;
int count = 0;
2024-08-12 17:51:31 +02:00
Fn<void()> click;
bool my = false;
};
2024-08-06 12:48:06 +02:00
struct PaidReactionBoxArgs {
int chosen = 0;
2024-08-07 18:09:32 +02:00
int max = 0;
2024-08-06 12:48:06 +02:00
std::vector<PaidReactionTop> top;
2024-08-06 12:48:06 +02:00
QString channel;
Fn<rpl::producer<TextWithContext>(rpl::producer<int> amount)> submit;
2024-11-21 22:42:58 +04:00
rpl::producer<StarsAmount> balanceValue;
2025-02-04 20:20:35 +04:00
Fn<void(int, uint64)> send;
2024-08-06 12:48:06 +02:00
};
void PaidReactionsBox(
not_null<GenericBox*> box,
PaidReactionBoxArgs &&args);
[[nodiscard]] object_ptr<BoxContent> MakePaidReactionBox(
PaidReactionBoxArgs &&args);
2025-02-21 21:29:10 +04:00
[[nodiscard]] QImage GenerateSmallBadgeImage(
QString text,
const style::icon &icon,
QColor bg,
QColor fg,
const style::RoundCheckbox *borderSt = nullptr);
2024-08-06 12:48:06 +02:00
} // namespace Ui