diff --git a/Telegram/Resources/icons/menu/channel.png b/Telegram/Resources/icons/menu/channel.png new file mode 100644 index 0000000000..df2823788f Binary files /dev/null and b/Telegram/Resources/icons/menu/channel.png differ diff --git a/Telegram/Resources/icons/menu/channel@2x.png b/Telegram/Resources/icons/menu/channel@2x.png new file mode 100644 index 0000000000..68e65eadea Binary files /dev/null and b/Telegram/Resources/icons/menu/channel@2x.png differ diff --git a/Telegram/Resources/icons/menu/channel@3x.png b/Telegram/Resources/icons/menu/channel@3x.png new file mode 100644 index 0000000000..e3f8e50d36 Binary files /dev/null and b/Telegram/Resources/icons/menu/channel@3x.png differ diff --git a/Telegram/Resources/icons/menu/info.png b/Telegram/Resources/icons/menu/info.png index 5076155d76..31404161c4 100644 Binary files a/Telegram/Resources/icons/menu/info.png and b/Telegram/Resources/icons/menu/info.png differ diff --git a/Telegram/Resources/icons/menu/info@2x.png b/Telegram/Resources/icons/menu/info@2x.png index 8da7d00c9d..c6287d1449 100644 Binary files a/Telegram/Resources/icons/menu/info@2x.png and b/Telegram/Resources/icons/menu/info@2x.png differ diff --git a/Telegram/Resources/icons/menu/info@3x.png b/Telegram/Resources/icons/menu/info@3x.png index 5811442cfd..e707aa012e 100644 Binary files a/Telegram/Resources/icons/menu/info@3x.png and b/Telegram/Resources/icons/menu/info@3x.png differ diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 16bb719ecf..c8b8416c12 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -158,7 +158,7 @@ void FillSponsoredMessagesMenu( auto item = base::make_unique_q( menu, st::defaultMenu, - st::historyHasCustomEmoji, + st::historySponsorInfoItem, st::historyHasCustomEmojiPosition, base::duplicate(i)); item->clicks( @@ -173,29 +173,14 @@ void FillSponsoredMessagesMenu( CreateAddActionCallback(menu)(MenuCallback::Args{ .text = tr::lng_sponsored_info_menu(tr::now), .handler = nullptr, - .icon = nullptr, + .icon = &st::menuIconChannel, .fillSubmenu = std::move(fillSubmenu), }); - menu->addSeparator(); + menu->addSeparator(&st::expandedMenuSeparator); } - { - auto item = base::make_unique_q( - menu, - st::menuWithIcons, - st::historyHasCustomEmoji, - st::historySponsoredAboutMenuLabelPosition, - TextWithEntities{ tr::lng_sponsored_title(tr::now) }, - &st::menuIconInfo); - item->clicks( - ) | rpl::start_with_next([=] { - controller->show(Box(Ui::AboutSponsoredBox)); - }, item->lifetime()); - menu->addAction(std::move(item)); - } - menu->addSeparator(); menu->addAction(tr::lng_sponsored_hide_ads(tr::now), [=] { Settings::ShowPremium(controller, "no_ads"); - }, &st::menuIconBlock); + }, &st::menuIconCancel); } } // namespace @@ -2530,6 +2515,21 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { HistoryView::CopyPostLink(controller, itemId, HistoryView::Context::History); }, &st::menuIconLink); } + if (item && item->isSponsored()) { + _menu->addSeparator(&st::expandedMenuSeparator); + auto item = base::make_unique_q( + _menu, + st::menuWithIcons, + st::historyHasCustomEmoji, + st::historySponsoredAboutMenuLabelPosition, + TextWithEntities{ tr::lng_sponsored_title(tr::now) }, + &st::menuIconInfo); + item->clicks( + ) | rpl::start_with_next([=] { + controller->show(Box(Ui::AboutSponsoredBox)); + }, item->lifetime()); + _menu->addAction(std::move(item)); + } if (isUponSelected > 1) { if (selectedState.count > 0 && selectedState.count == selectedState.canForwardCount) { _menu->addAction(tr::lng_context_forward_selected(tr::now), [=] { diff --git a/Telegram/SourceFiles/ui/chat/chat.style b/Telegram/SourceFiles/ui/chat/chat.style index d5768e3647..e8cc28f473 100644 --- a/Telegram/SourceFiles/ui/chat/chat.style +++ b/Telegram/SourceFiles/ui/chat/chat.style @@ -1232,6 +1232,13 @@ msgServiceGiftBoxTitlePadding: margins(0px, 5px, 0px, 2px); msgServiceGiftBoxStickerTop: -19px; msgServiceGiftBoxStickerSize: size(140px, 140px); +historySponsorInfoItem: FlatLabel(defaultFlatLabel) { + style: TextStyle(defaultTextStyle) { + font: font(12px); + } + minWidth: 136px; + maxHeight: 40px; +} historyHasCustomEmoji: FlatLabel(defaultFlatLabel) { style: TextStyle(defaultTextStyle) { font: font(11px); diff --git a/Telegram/SourceFiles/ui/menu_icons.style b/Telegram/SourceFiles/ui/menu_icons.style index cf78f2bdc6..999df51ada 100644 --- a/Telegram/SourceFiles/ui/menu_icons.style +++ b/Telegram/SourceFiles/ui/menu_icons.style @@ -103,6 +103,7 @@ menuIconPhotoSuggest: icon {{ "menu/photo_suggest", menuIconColor }}; menuIconNewWindow: icon {{ "menu/new_window", menuIconColor }}; menuIconChatBubble: icon {{ "menu/chat_bubble", menuIconColor }}; menuIconPhone: icon {{ "menu/phone", menuIconColor }}; +menuIconChannel: icon {{ "menu/channel", menuIconColor }}; menuIconTTLAny: icon {{ "menu/auto_delete_plain", menuIconColor }}; menuIconTTLAnyTextPosition: point(11px, 22px);