mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 05:07:10 +02:00
Fixed reward label for point details widget in credits statistics.
This commit is contained in:
parent
f90a4db569
commit
c08266f81b
2 changed files with 13 additions and 4 deletions
|
@ -5968,6 +5968,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"lng_channel_earn_learn_coin_link" = "https://telegram.org/blog/monetization-for-channels";
|
||||
"lng_channel_earn_chart_top_hours" = "Ad impressions";
|
||||
"lng_channel_earn_chart_revenue" = "Ad rewards";
|
||||
"lng_channel_earn_chart_overriden_detail_credits" = "Rewards in Stars";
|
||||
"lng_channel_earn_chart_overriden_detail_currency" = "Rewards in TON";
|
||||
"lng_channel_earn_chart_overriden_detail_usd" = "Rewards in USD";
|
||||
"lng_channel_earn_currency_history" = "TON Transactions";
|
||||
|
|
|
@ -214,6 +214,8 @@ PointDetailsWidget::PointDetailsWidget(
|
|||
|
||||
const auto calculatedWidth = [&]{
|
||||
auto maxNameTextWidth = 0;
|
||||
const auto isCredits
|
||||
= _chartData.currency == Data::StatisticalCurrency::Credits;
|
||||
for (const auto &dataLine : _chartData.lines) {
|
||||
const auto maxNameText = Ui::Text::String(
|
||||
_textStyle,
|
||||
|
@ -222,10 +224,12 @@ PointDetailsWidget::PointDetailsWidget(
|
|||
maxNameText.maxWidth(),
|
||||
maxNameTextWidth);
|
||||
if (hasUsdLine) {
|
||||
const auto text = isCredits
|
||||
? tr::lng_channel_earn_chart_overriden_detail_credits
|
||||
: tr::lng_channel_earn_chart_overriden_detail_currency;
|
||||
const auto currency = Ui::Text::String(
|
||||
_textStyle,
|
||||
tr::lng_channel_earn_chart_overriden_detail_currency(
|
||||
tr::now));
|
||||
text(tr::now));
|
||||
const auto usd = Ui::Text::String(
|
||||
_textStyle,
|
||||
tr::lng_channel_earn_chart_overriden_detail_usd(
|
||||
|
@ -322,6 +326,8 @@ void PointDetailsWidget::setXIndex(int xIndex) {
|
|||
{ float64(xIndex), float64(xIndex) }).parts
|
||||
: std::vector<PiePartData::Part>();
|
||||
const auto multiplier = float64(Data::kEarnMultiplier);
|
||||
const auto isCredits
|
||||
= _chartData.currency == Data::StatisticalCurrency::Credits;
|
||||
for (auto i = 0; i < _chartData.lines.size(); i++) {
|
||||
const auto &dataLine = _chartData.lines[i];
|
||||
auto textLine = Line();
|
||||
|
@ -341,8 +347,10 @@ void PointDetailsWidget::setXIndex(int xIndex) {
|
|||
copy.valueColor = QColor(dataLine.color);
|
||||
copy.name.setText(
|
||||
_textStyle,
|
||||
tr::lng_channel_earn_chart_overriden_detail_currency(
|
||||
tr::now));
|
||||
(isCredits
|
||||
? tr::lng_channel_earn_chart_overriden_detail_credits
|
||||
: tr::lng_channel_earn_chart_overriden_detail_currency)(
|
||||
tr::now));
|
||||
copy.value.setText(
|
||||
_textStyle,
|
||||
Lang::FormatExactCountDecimal(
|
||||
|
|
Loading…
Add table
Reference in a new issue