mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 07:07:08 +02:00
Support entities in star gift message in box.
This commit is contained in:
parent
9ace04d2c9
commit
a3ca8ddcfc
2 changed files with 19 additions and 4 deletions
Telegram/SourceFiles
|
@ -1796,12 +1796,23 @@ void AddStarGiftTable(
|
|||
Ui::Text::WithEntities)));
|
||||
}
|
||||
if (!entry.description.empty()) {
|
||||
const auto session = &controller->session();
|
||||
const auto makeContext = [=](Fn<void()> update) {
|
||||
return Core::MarkedTextContext{
|
||||
.session = session,
|
||||
.customEmojiRepaint = std::move(update),
|
||||
};
|
||||
};
|
||||
auto label = object_ptr<Ui::FlatLabel>(
|
||||
table,
|
||||
rpl::single(entry.description),
|
||||
st::giveawayGiftMessage,
|
||||
st::defaultPopupMenu,
|
||||
makeContext);
|
||||
label->setSelectable(true);
|
||||
table->addRow(
|
||||
nullptr,
|
||||
object_ptr<Ui::FlatLabel>(
|
||||
table,
|
||||
rpl::single(entry.description),
|
||||
st::giveawayGiftCodeValue),
|
||||
std::move(label),
|
||||
st::giveawayGiftCodeLabelMargin,
|
||||
st::giveawayGiftCodeValueMargin);
|
||||
}
|
||||
|
|
|
@ -97,6 +97,10 @@ giveawayGiftCodeValueMultiline: FlatLabel(giveawayGiftCodeValue) {
|
|||
minWidth: 128px;
|
||||
maxHeight: 100px;
|
||||
}
|
||||
giveawayGiftMessage: FlatLabel(giveawayGiftCodeValue) {
|
||||
minWidth: 128px;
|
||||
maxHeight: 0px;
|
||||
}
|
||||
giveawayGiftCodeValueMargin: margins(13px, 9px, 13px, 9px);
|
||||
giveawayGiftCodePeerMargin: margins(11px, 6px, 11px, 4px);
|
||||
giveawayGiftCodeUserpic: UserpicButton(defaultUserpicButton) {
|
||||
|
|
Loading…
Add table
Reference in a new issue