mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-05-30 03:33:55 +02:00
Fixed ability to copy transactions id from credits history entries.
Regression was introduced in 77e7796b3f
.
This commit is contained in:
parent
d69905feae
commit
2ae4e15f87
1 changed files with 3 additions and 15 deletions
|
@ -1255,24 +1255,12 @@ void AddCreditsHistoryEntryTable(
|
||||||
Ui::Text::WithEntities));
|
Ui::Text::WithEntities));
|
||||||
}
|
}
|
||||||
if (!entry.id.isEmpty()) {
|
if (!entry.id.isEmpty()) {
|
||||||
constexpr auto kOneLineCount = 22;
|
constexpr auto kOneLineCount = 24;
|
||||||
const auto oneLine = entry.id.size() <= kOneLineCount;
|
const auto oneLine = entry.id.length() <= 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>(
|
auto label = object_ptr<Ui::FlatLabel>(
|
||||||
table,
|
table,
|
||||||
rpl::single(
|
rpl::single(
|
||||||
Ui::Text::Wrapped(
|
Ui::Text::Wrapped({ entry.id }, EntityType::Code, {})),
|
||||||
{ oneLine ? entry.id : std::move(multiLine) },
|
|
||||||
EntityType::Code,
|
|
||||||
{})),
|
|
||||||
oneLine
|
oneLine
|
||||||
? st::giveawayGiftCodeValue
|
? st::giveawayGiftCodeValue
|
||||||
: st::giveawayGiftCodeValueMultiline);
|
: st::giveawayGiftCodeValueMultiline);
|
||||||
|
|
Loading…
Add table
Reference in a new issue