mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-13 04:37:11 +02:00
Fit transactions id from credits history entries to table cell.
This commit is contained in:
parent
983c949e8c
commit
77e7796b3f
2 changed files with 19 additions and 3 deletions
|
@ -1242,12 +1242,24 @@ void AddCreditsHistoryEntryTable(
|
|||
}
|
||||
}
|
||||
if (!entry.id.isEmpty()) {
|
||||
constexpr auto kOneLineCount = 18;
|
||||
const auto oneLine = entry.id.length() <= kOneLineCount;
|
||||
constexpr auto kOneLineCount = 22;
|
||||
const auto oneLine = entry.id.size() <= kOneLineCount;
|
||||
auto multiLine = QString();
|
||||
if (!oneLine) {
|
||||
for (auto i = 0; i < entry.id.size(); ++i) {
|
||||
multiLine.append(entry.id[i]);
|
||||
if ((i + 1) % kOneLineCount == 0) {
|
||||
multiLine.append('\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
auto label = object_ptr<Ui::FlatLabel>(
|
||||
table,
|
||||
rpl::single(
|
||||
Ui::Text::Wrapped({ entry.id }, EntityType::Code, {})),
|
||||
Ui::Text::Wrapped(
|
||||
{ oneLine ? entry.id : std::move(multiLine) },
|
||||
EntityType::Code,
|
||||
{})),
|
||||
oneLine
|
||||
? st::giveawayGiftCodeValue
|
||||
: st::giveawayGiftCodeValueMultiline);
|
||||
|
|
|
@ -96,6 +96,10 @@ giveawayGiftCodeValue: FlatLabel(defaultFlatLabel) {
|
|||
giveawayGiftCodeValueMultiline: FlatLabel(giveawayGiftCodeValue) {
|
||||
minWidth: 128px;
|
||||
maxHeight: 100px;
|
||||
style: TextStyle(defaultTextStyle) {
|
||||
font: font(10px);
|
||||
linkUnderline: kLinkUnderlineNever;
|
||||
}
|
||||
}
|
||||
giveawayGiftMessage: FlatLabel(giveawayGiftCodeValue) {
|
||||
minWidth: 128px;
|
||||
|
|
Loading…
Add table
Reference in a new issue