Fix bottom shadow in premium settings.

This commit is contained in:
John Preston 2022-06-09 11:00:29 +04:00
parent bfe873e91c
commit 1b604bed0b
5 changed files with 16 additions and 0 deletions

View File

@ -3311,6 +3311,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_view_button_voice_chat_channel" = "Live stream";
"lng_view_button_request_join" = "Request to Join";
"lng_sponsored_hide_ads" = "Hide";
"lng_sponsored_title" = "What are sponsored messages?";
"lng_sponsored_info_description1" = "Unlike other apps, Telegram never uses your private data to target ads. Sponsored messages on Telegram are based solely on the topic of the public channels in which they are shown. This means that no user data is mined or analyzed to display ads, and every user viewing a channel on Telegram sees the same sponsored messages.\n\nUnlike other apps, Telegram doesn't track whether you tapped on a sponsored message and doesn't profile you based on your activity. We also prevent external links in sponsored messages to ensure that third parties cant spy on our users. We believe that everyone has the right to privacy, and technological platforms should respect that.\n\nTelegram offers a free and unlimited service to hundreds of millions of users, which involves significant server and traffic costs. In order to remain independent and stay true to its values, Telegram developed a paid tool to promote messages with user privacy in mind. We welcome responsible advertisers at:";
"lng_sponsored_info_description2" = "Sponsored Messages are currently in test mode. Once they are fully launched and allow Telegram to cover its basic costs, we will start sharing ad revenue with the owners of public channels in which sponsored messages are displayed.\n\nOnline ads should no longer be synonymous with abuse of user privacy. Let us redefine how a tech company should operate together.";

View File

@ -85,6 +85,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/stickers/data_stickers.h"
#include "data/data_sponsored_messages.h"
#include "dialogs/ui/dialogs_video_userpic.h"
#include "settings/settings_premium.h"
#include "facades.h"
#include "styles/style_chat.h"
#include "styles/style_window.h" // st::windowMinWidth
@ -2324,6 +2325,10 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
_menu->addAction(tr::lng_sponsored_title({}), [=] {
_controller->show(Box(Ui::AboutSponsoredBox));
}, &st::menuIconInfo);
_menu->addSeparator();
_menu->addAction(tr::lng_sponsored_hide_ads({}), [=] {
Settings::ShowPremium(_controller, "no_ads");
}, &st::menuIconBlock);
}
if (!item->isService()
&& view

View File

@ -307,6 +307,10 @@ int ContentWidget::scrollBottomSkip() const {
return _scrollBottomSkip.current();
}
rpl::producer<int> ContentWidget::scrollBottomSkipValue() const {
return _scrollBottomSkip.value();
}
rpl::producer<bool> ContentWidget::desiredBottomShadowVisibility() const {
using namespace rpl::mappers;
return rpl::combine(

View File

@ -86,6 +86,7 @@ public:
virtual void saveChanges(FnMut<void()> done);
[[nodiscard]] int scrollBottomSkip() const;
[[nodiscard]] rpl::producer<int> scrollBottomSkipValue() const;
[[nodiscard]] rpl::producer<bool> desiredBottomShadowVisibility() const;
protected:

View File

@ -687,6 +687,11 @@ void WrapWidget::finishShowContent() {
_bottomShadow->finishAnimating();
_contentChanges.fire({});
_content->scrollBottomSkipValue(
) | rpl::start_with_next([=] {
updateContentGeometry();
}, _content->lifetime());
// This was done for tabs support.
//
//if (_topTabs) {