mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added icon to label in withdrawal button from bot earn section.
This commit is contained in:
parent
301ffc15ef
commit
712c06756e
1 changed files with 31 additions and 0 deletions
|
@ -37,6 +37,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "styles/style_channel_earn.h"
|
#include "styles/style_channel_earn.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat.h"
|
||||||
#include "styles/style_layers.h"
|
#include "styles/style_layers.h"
|
||||||
|
#include "styles/style_settings.h"
|
||||||
#include "styles/style_statistics.h"
|
#include "styles/style_statistics.h"
|
||||||
|
|
||||||
namespace Info::BotEarn {
|
namespace Info::BotEarn {
|
||||||
|
@ -343,6 +344,36 @@ void InnerWidget::fill() {
|
||||||
button,
|
button,
|
||||||
tr::lng_channel_earn_balance_button(tr::now),
|
tr::lng_channel_earn_balance_button(tr::now),
|
||||||
st::channelEarnSemiboldLabel);
|
st::channelEarnSemiboldLabel);
|
||||||
|
{
|
||||||
|
const auto buttonEmoji = Ui::Text::SingleCustomEmoji(
|
||||||
|
session->data().customEmojiManager().registerInternalEmoji(
|
||||||
|
st::settingsPremiumIconStar,
|
||||||
|
{ 0, -st::moderateBoxExpandInnerSkip, 0, 0 },
|
||||||
|
true));
|
||||||
|
const auto context = Core::MarkedTextContext{
|
||||||
|
.customEmojiRepaint = [=] { label->update(); },
|
||||||
|
.session = session,
|
||||||
|
};
|
||||||
|
const auto process = [=] {
|
||||||
|
const auto amount = input->getLastText().toDouble();
|
||||||
|
if (amount >= _state.availableBalance) {
|
||||||
|
label->setText(
|
||||||
|
tr::lng_bot_earn_balance_button_all(tr::now));
|
||||||
|
} else {
|
||||||
|
label->setMarkedText(
|
||||||
|
tr::lng_bot_earn_balance_button(
|
||||||
|
tr::now,
|
||||||
|
lt_count,
|
||||||
|
amount,
|
||||||
|
lt_emoji,
|
||||||
|
buttonEmoji,
|
||||||
|
Ui::Text::RichLangValue),
|
||||||
|
context);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
QObject::connect(input, &Ui::MaskedInputField::changed, process);
|
||||||
|
process();
|
||||||
|
}
|
||||||
label->setTextColorOverride(stButton.textFg->c);
|
label->setTextColorOverride(stButton.textFg->c);
|
||||||
label->setAttribute(Qt::WA_TransparentForMouseEvents);
|
label->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
|
|
Loading…
Add table
Reference in a new issue