mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Provided character count of large file caption to premium limit box.
This commit is contained in:
parent
3959918fc5
commit
95cc27b145
2 changed files with 12 additions and 5 deletions
|
@ -781,7 +781,8 @@ void PinsLimitBox(
|
||||||
|
|
||||||
void CaptionLimitBox(
|
void CaptionLimitBox(
|
||||||
not_null<Ui::GenericBox*> box,
|
not_null<Ui::GenericBox*> box,
|
||||||
not_null<Main::Session*> session) {
|
not_null<Main::Session*> session,
|
||||||
|
int remove) {
|
||||||
const auto premium = session->premium();
|
const auto premium = session->premium();
|
||||||
|
|
||||||
const auto defaultLimit = Limit(
|
const auto defaultLimit = Limit(
|
||||||
|
@ -792,11 +793,16 @@ void CaptionLimitBox(
|
||||||
session,
|
session,
|
||||||
"caption_length_limit_premium",
|
"caption_length_limit_premium",
|
||||||
2048);
|
2048);
|
||||||
|
const auto currentLimit = premium ? premiumLimit : defaultLimit;
|
||||||
|
const auto current = std::clamp(
|
||||||
|
remove + currentLimit,
|
||||||
|
defaultLimit,
|
||||||
|
premiumLimit);
|
||||||
|
|
||||||
auto text = rpl::combine(
|
auto text = rpl::combine(
|
||||||
tr::lng_caption_limit1(
|
tr::lng_caption_limit1(
|
||||||
lt_count,
|
lt_count,
|
||||||
rpl::single(premium ? premiumLimit : defaultLimit),
|
rpl::single(currentLimit),
|
||||||
Ui::Text::RichLangValue),
|
Ui::Text::RichLangValue),
|
||||||
tr::lng_caption_limit2(
|
tr::lng_caption_limit2(
|
||||||
lt_count,
|
lt_count,
|
||||||
|
@ -812,7 +818,7 @@ void CaptionLimitBox(
|
||||||
tr::lng_caption_limit_title(),
|
tr::lng_caption_limit_title(),
|
||||||
std::move(text),
|
std::move(text),
|
||||||
"caption_length",
|
"caption_length",
|
||||||
{ defaultLimit, defaultLimit, premiumLimit, &st::premiumIconChats },
|
{ defaultLimit, current, premiumLimit, &st::premiumIconChats },
|
||||||
premium);
|
premium);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -827,7 +833,7 @@ void CaptionLimitReachedBox(
|
||||||
if (!session->premium()) {
|
if (!session->premium()) {
|
||||||
box->addLeftButton(tr::lng_limits_increase(), [=] {
|
box->addLeftButton(tr::lng_limits_increase(), [=] {
|
||||||
box->getDelegate()->showBox(
|
box->getDelegate()->showBox(
|
||||||
Box(CaptionLimitBox, session),
|
Box(CaptionLimitBox, session, remove),
|
||||||
Ui::LayerOption::KeepOther,
|
Ui::LayerOption::KeepOther,
|
||||||
anim::type::normal);
|
anim::type::normal);
|
||||||
box->closeBox();
|
box->closeBox();
|
||||||
|
|
|
@ -41,7 +41,8 @@ void PinsLimitBox(
|
||||||
not_null<Main::Session*> session);
|
not_null<Main::Session*> session);
|
||||||
void CaptionLimitBox(
|
void CaptionLimitBox(
|
||||||
not_null<Ui::GenericBox*> box,
|
not_null<Ui::GenericBox*> box,
|
||||||
not_null<Main::Session*> session);
|
not_null<Main::Session*> session,
|
||||||
|
int remove);
|
||||||
void CaptionLimitReachedBox(
|
void CaptionLimitReachedBox(
|
||||||
not_null<Ui::GenericBox*> box,
|
not_null<Ui::GenericBox*> box,
|
||||||
not_null<Main::Session*> session,
|
not_null<Main::Session*> session,
|
||||||
|
|
Loading…
Add table
Reference in a new issue