mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-01 17:57:51 +00:00
Fixed display of out currency entries in settings for credits section.
This commit is contained in:
@@ -1502,19 +1502,23 @@ void AddEmojiToMajor(
|
||||
value
|
||||
) | rpl::on_next([=](CreditsAmount v) {
|
||||
auto helper = Ui::Text::CustomEmojiHelper();
|
||||
auto icon = helper.paletteDependent({ .factory = [=] {
|
||||
return Ui::Earn::IconCurrencyColored(
|
||||
st.style.font,
|
||||
!isIn
|
||||
? st::currencyFg->c
|
||||
: (*isIn)
|
||||
? st::boxTextFgGood->c
|
||||
: st::menuIconAttentionColor->c);
|
||||
}, .margin = margins
|
||||
auto icon = helper.paletteDependent({
|
||||
.factory = [=] {
|
||||
return Ui::Earn::IconCurrencyColored(
|
||||
st.style.font,
|
||||
!isIn
|
||||
? st::currencyFg->c
|
||||
: (*isIn)
|
||||
? st::boxTextFgGood->c
|
||||
: st::menuIconAttentionColor->c);
|
||||
},
|
||||
.margin = margins
|
||||
? *margins
|
||||
: st::channelEarnCurrencyCommonMargins });
|
||||
: st::channelEarnCurrencyCommonMargins
|
||||
});
|
||||
auto value = MajorPart(v.abs());
|
||||
label->setMarkedText(
|
||||
base::duplicate(prepended).append(icon).append(MajorPart(v)),
|
||||
base::duplicate(prepended).append(icon).append(value),
|
||||
helper.context());
|
||||
}, label->lifetime());
|
||||
}
|
||||
|
||||
@@ -978,7 +978,7 @@ void CreditsRow::init() {
|
||||
TextWithEntities()
|
||||
.append(_entry.in ? QChar('+') : kMinus)
|
||||
.append(isCurrency
|
||||
? Info::ChannelEarn::MajorPart(_entry.credits)
|
||||
? Info::ChannelEarn::MajorPart(_entry.credits.abs())
|
||||
: Lang::FormatCreditsAmountDecimal(_entry.credits.abs()))
|
||||
.append(QChar(' '))
|
||||
.append(isCurrency
|
||||
|
||||
Reference in New Issue
Block a user