mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-03 21:54:05 +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_learn_coin_link" = "https://telegram.org/blog/monetization-for-channels";
|
||||||
"lng_channel_earn_chart_top_hours" = "Ad impressions";
|
"lng_channel_earn_chart_top_hours" = "Ad impressions";
|
||||||
"lng_channel_earn_chart_revenue" = "Ad rewards";
|
"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_currency" = "Rewards in TON";
|
||||||
"lng_channel_earn_chart_overriden_detail_usd" = "Rewards in USD";
|
"lng_channel_earn_chart_overriden_detail_usd" = "Rewards in USD";
|
||||||
"lng_channel_earn_currency_history" = "TON Transactions";
|
"lng_channel_earn_currency_history" = "TON Transactions";
|
||||||
|
|
|
@ -214,6 +214,8 @@ PointDetailsWidget::PointDetailsWidget(
|
||||||
|
|
||||||
const auto calculatedWidth = [&]{
|
const auto calculatedWidth = [&]{
|
||||||
auto maxNameTextWidth = 0;
|
auto maxNameTextWidth = 0;
|
||||||
|
const auto isCredits
|
||||||
|
= _chartData.currency == Data::StatisticalCurrency::Credits;
|
||||||
for (const auto &dataLine : _chartData.lines) {
|
for (const auto &dataLine : _chartData.lines) {
|
||||||
const auto maxNameText = Ui::Text::String(
|
const auto maxNameText = Ui::Text::String(
|
||||||
_textStyle,
|
_textStyle,
|
||||||
|
@ -222,10 +224,12 @@ PointDetailsWidget::PointDetailsWidget(
|
||||||
maxNameText.maxWidth(),
|
maxNameText.maxWidth(),
|
||||||
maxNameTextWidth);
|
maxNameTextWidth);
|
||||||
if (hasUsdLine) {
|
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(
|
const auto currency = Ui::Text::String(
|
||||||
_textStyle,
|
_textStyle,
|
||||||
tr::lng_channel_earn_chart_overriden_detail_currency(
|
text(tr::now));
|
||||||
tr::now));
|
|
||||||
const auto usd = Ui::Text::String(
|
const auto usd = Ui::Text::String(
|
||||||
_textStyle,
|
_textStyle,
|
||||||
tr::lng_channel_earn_chart_overriden_detail_usd(
|
tr::lng_channel_earn_chart_overriden_detail_usd(
|
||||||
|
@ -322,6 +326,8 @@ void PointDetailsWidget::setXIndex(int xIndex) {
|
||||||
{ float64(xIndex), float64(xIndex) }).parts
|
{ float64(xIndex), float64(xIndex) }).parts
|
||||||
: std::vector<PiePartData::Part>();
|
: std::vector<PiePartData::Part>();
|
||||||
const auto multiplier = float64(Data::kEarnMultiplier);
|
const auto multiplier = float64(Data::kEarnMultiplier);
|
||||||
|
const auto isCredits
|
||||||
|
= _chartData.currency == Data::StatisticalCurrency::Credits;
|
||||||
for (auto i = 0; i < _chartData.lines.size(); i++) {
|
for (auto i = 0; i < _chartData.lines.size(); i++) {
|
||||||
const auto &dataLine = _chartData.lines[i];
|
const auto &dataLine = _chartData.lines[i];
|
||||||
auto textLine = Line();
|
auto textLine = Line();
|
||||||
|
@ -341,8 +347,10 @@ void PointDetailsWidget::setXIndex(int xIndex) {
|
||||||
copy.valueColor = QColor(dataLine.color);
|
copy.valueColor = QColor(dataLine.color);
|
||||||
copy.name.setText(
|
copy.name.setText(
|
||||||
_textStyle,
|
_textStyle,
|
||||||
tr::lng_channel_earn_chart_overriden_detail_currency(
|
(isCredits
|
||||||
tr::now));
|
? tr::lng_channel_earn_chart_overriden_detail_credits
|
||||||
|
: tr::lng_channel_earn_chart_overriden_detail_currency)(
|
||||||
|
tr::now));
|
||||||
copy.value.setText(
|
copy.value.setText(
|
||||||
_textStyle,
|
_textStyle,
|
||||||
Lang::FormatExactCountDecimal(
|
Lang::FormatExactCountDecimal(
|
||||||
|
|
Loading…
Add table
Reference in a new issue