mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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
|
@ -1796,12 +1796,23 @@ void AddStarGiftTable(
|
||||||
Ui::Text::WithEntities)));
|
Ui::Text::WithEntities)));
|
||||||
}
|
}
|
||||||
if (!entry.description.empty()) {
|
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(
|
table->addRow(
|
||||||
nullptr,
|
nullptr,
|
||||||
object_ptr<Ui::FlatLabel>(
|
std::move(label),
|
||||||
table,
|
|
||||||
rpl::single(entry.description),
|
|
||||||
st::giveawayGiftCodeValue),
|
|
||||||
st::giveawayGiftCodeLabelMargin,
|
st::giveawayGiftCodeLabelMargin,
|
||||||
st::giveawayGiftCodeValueMargin);
|
st::giveawayGiftCodeValueMargin);
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,6 +97,10 @@ giveawayGiftCodeValueMultiline: FlatLabel(giveawayGiftCodeValue) {
|
||||||
minWidth: 128px;
|
minWidth: 128px;
|
||||||
maxHeight: 100px;
|
maxHeight: 100px;
|
||||||
}
|
}
|
||||||
|
giveawayGiftMessage: FlatLabel(giveawayGiftCodeValue) {
|
||||||
|
minWidth: 128px;
|
||||||
|
maxHeight: 0px;
|
||||||
|
}
|
||||||
giveawayGiftCodeValueMargin: margins(13px, 9px, 13px, 9px);
|
giveawayGiftCodeValueMargin: margins(13px, 9px, 13px, 9px);
|
||||||
giveawayGiftCodePeerMargin: margins(11px, 6px, 11px, 4px);
|
giveawayGiftCodePeerMargin: margins(11px, 6px, 11px, 4px);
|
||||||
giveawayGiftCodeUserpic: UserpicButton(defaultUserpicButton) {
|
giveawayGiftCodeUserpic: UserpicButton(defaultUserpicButton) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue