mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Fixed reward label for point details widget in credits statistics.
This commit is contained in:
@@ -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(
|
||||
|
Reference in New Issue
Block a user