diff --git a/Telegram/Resources/animations/edit_peers/direct_messages.tgs b/Telegram/Resources/animations/edit_peers/direct_messages.tgs new file mode 100644 index 0000000000..3a0806e1ae Binary files /dev/null and b/Telegram/Resources/animations/edit_peers/direct_messages.tgs differ diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 0253369e8d..9efcdd8784 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -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"; diff --git a/Telegram/Resources/qrc/telegram/animations.qrc b/Telegram/Resources/qrc/telegram/animations.qrc index 09702ee5d0..98917d9924 100644 --- a/Telegram/Resources/qrc/telegram/animations.qrc +++ b/Telegram/Resources/qrc/telegram/animations.qrc @@ -36,6 +36,7 @@ ../../animations/edit_peers/topics.tgs ../../animations/edit_peers/topics_tabs.tgs ../../animations/edit_peers/topics_list.tgs + ../../animations/edit_peers/direct_messages.tgs ../../animations/dice/dice_idle.tgs ../../animations/dice/dart_idle.tgs diff --git a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp index 2047539943..88ebe4ccbb 100644 --- a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp @@ -511,8 +511,9 @@ auto PrivacyExceptionsBoxController::createRow(not_null 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 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 savedValue, Fn)> callback) { box->setTitle(tr::lng_manage_monoforum()); + box->setWidth(st::boxWideWidth); - const auto toggle = box->addRow(object_ptr( + 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( 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>( diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp index 9ae378d7db..4604c4f6a7 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp @@ -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() {