mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-25 15:03:03 +02:00
Improve set direct message price box.
This commit is contained in:
parent
d0e5ea78a5
commit
5b15f377cd
5 changed files with 34 additions and 14 deletions
BIN
Telegram/Resources/animations/edit_peers/direct_messages.tgs
Normal file
BIN
Telegram/Resources/animations/edit_peers/direct_messages.tgs
Normal file
Binary file not shown.
|
@ -1891,9 +1891,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"lng_manage_monoforum" = "Direct Messages";
|
||||
"lng_manage_monoforum_off" = "Off";
|
||||
"lng_manage_monoforum_free" = "Free";
|
||||
"lng_manage_monoforum_allow" = "Allow Direct Messages";
|
||||
"lng_manage_monoforum_about" = "Allow users to write direct private messages to your channel, with the option to charge a fee for every message.";
|
||||
"lng_manage_monoforum_price_about" = "Charge users for the ability to write a direct message to your channel. Your channel will receive {percent} of the selected fee ({amount}) for each incoming message.";
|
||||
"lng_manage_monoforum_allow" = "Allow Channel Messages";
|
||||
"lng_manage_monoforum_price" = "Price for each message";
|
||||
"lng_manage_monoforum_about" = "Allow users to send messages to your channel, with the option to charge a fee for each message.";
|
||||
"lng_manage_monoforum_price_about" = "Your channel will receive {percent} of the selected fee ({amount}) for each incoming message.";
|
||||
|
||||
"lng_manage_history_visibility_title" = "Chat history for new members";
|
||||
"lng_manage_history_visibility_shown" = "Visible";
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
<file alias="topics.tgs">../../animations/edit_peers/topics.tgs</file>
|
||||
<file alias="topics_tabs.tgs">../../animations/edit_peers/topics_tabs.tgs</file>
|
||||
<file alias="topics_list.tgs">../../animations/edit_peers/topics_list.tgs</file>
|
||||
<file alias="direct_messages.tgs">../../animations/edit_peers/direct_messages.tgs</file>
|
||||
|
||||
<file alias="dice_idle.tgs">../../animations/dice/dice_idle.tgs</file>
|
||||
<file alias="dart_idle.tgs">../../animations/dice/dart_idle.tgs</file>
|
||||
|
|
|
@ -511,8 +511,9 @@ auto PrivacyExceptionsBoxController::createRow(not_null<History*> history)
|
|||
current->moveToLeft((outer - current->width()) / 2, 0, outer);
|
||||
};
|
||||
const auto updateByValue = [=](int value) {
|
||||
current->setText(
|
||||
tr::lng_action_gift_for_stars(tr::now, lt_count, value));
|
||||
current->setText(value > 0
|
||||
? tr::lng_action_gift_for_stars(tr::now, lt_count, value)
|
||||
: tr::lng_manage_monoforum_free(tr::now));
|
||||
|
||||
state->index = 0;
|
||||
auto maxIndex = valuesCount - 1;
|
||||
|
@ -1178,7 +1179,9 @@ rpl::producer<int> SetupChargeSlider(
|
|||
const auto chargeStars = savedValue.value_or(defaultValue);
|
||||
state->stars = chargeStars;
|
||||
|
||||
Ui::AddSubsectionTitle(container, (group || broadcast)
|
||||
Ui::AddSubsectionTitle(container, broadcast
|
||||
? tr::lng_manage_monoforum_price()
|
||||
: group
|
||||
? tr::lng_rights_charge_price()
|
||||
: tr::lng_messages_privacy_price());
|
||||
|
||||
|
@ -1251,17 +1254,32 @@ void EditDirectMessagesPriceBox(
|
|||
std::optional<int> savedValue,
|
||||
Fn<void(std::optional<int>)> callback) {
|
||||
box->setTitle(tr::lng_manage_monoforum());
|
||||
box->setWidth(st::boxWideWidth);
|
||||
|
||||
const auto toggle = box->addRow(object_ptr<Ui::SettingsButton>(
|
||||
const auto container = box->verticalLayout();
|
||||
|
||||
Settings::AddDividerTextWithLottie(container, {
|
||||
.lottie = u"direct_messages"_q,
|
||||
.lottieSize = st::settingsFilterIconSize,
|
||||
.lottieMargins = st::settingsFilterIconPadding,
|
||||
.showFinished = box->showFinishes(),
|
||||
.about = tr::lng_manage_monoforum_about(
|
||||
Ui::Text::RichLangValue
|
||||
),
|
||||
.aboutMargins = st::settingsFilterDividerLabelPadding,
|
||||
});
|
||||
|
||||
Ui::AddSkip(container);
|
||||
|
||||
const auto toggle = container->add(object_ptr<Ui::SettingsButton>(
|
||||
box,
|
||||
tr::lng_manage_monoforum_allow(),
|
||||
st::settingsButtonNoIcon
|
||||
), {})->toggleOn(rpl::single(savedValue.has_value()));
|
||||
Ui::AddSkip(box->verticalLayout());
|
||||
st::settingsButtonNoIcon));
|
||||
toggle->toggleOn(rpl::single(savedValue.has_value()));
|
||||
|
||||
Ui::AddDividerText(
|
||||
box->verticalLayout(),
|
||||
tr::lng_manage_monoforum_about());
|
||||
Ui::AddSkip(container);
|
||||
Ui::AddDivider(container);
|
||||
Ui::AddSkip(container);
|
||||
|
||||
const auto wrap = box->addRow(
|
||||
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
|
||||
|
|
|
@ -1087,7 +1087,7 @@ void Controller::fillDirectMessagesButton() {
|
|||
tr::lng_manage_monoforum(),
|
||||
std::move(label),
|
||||
[=] { showEditDirectMessagesBox(); },
|
||||
{ .icon = &st::menuIconChatBubble, .newBadge = true });
|
||||
{ .icon = &st::menuIconChats, .newBadge = true });
|
||||
}
|
||||
//
|
||||
//void Controller::fillInviteLinkButton() {
|
||||
|
|
Loading…
Add table
Reference in a new issue