Slightly improved style of menu for sponsored messages.
After Width: | Height: | Size: 610 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 546 B After Width: | Height: | Size: 463 B |
Before Width: | Height: | Size: 949 B After Width: | Height: | Size: 1016 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
@ -158,7 +158,7 @@ void FillSponsoredMessagesMenu(
|
||||||
auto item = base::make_unique_q<Ui::Menu::MultilineAction>(
|
auto item = base::make_unique_q<Ui::Menu::MultilineAction>(
|
||||||
menu,
|
menu,
|
||||||
st::defaultMenu,
|
st::defaultMenu,
|
||||||
st::historyHasCustomEmoji,
|
st::historySponsorInfoItem,
|
||||||
st::historyHasCustomEmojiPosition,
|
st::historyHasCustomEmojiPosition,
|
||||||
base::duplicate(i));
|
base::duplicate(i));
|
||||||
item->clicks(
|
item->clicks(
|
||||||
|
@ -173,29 +173,14 @@ void FillSponsoredMessagesMenu(
|
||||||
CreateAddActionCallback(menu)(MenuCallback::Args{
|
CreateAddActionCallback(menu)(MenuCallback::Args{
|
||||||
.text = tr::lng_sponsored_info_menu(tr::now),
|
.text = tr::lng_sponsored_info_menu(tr::now),
|
||||||
.handler = nullptr,
|
.handler = nullptr,
|
||||||
.icon = nullptr,
|
.icon = &st::menuIconChannel,
|
||||||
.fillSubmenu = std::move(fillSubmenu),
|
.fillSubmenu = std::move(fillSubmenu),
|
||||||
});
|
});
|
||||||
menu->addSeparator();
|
menu->addSeparator(&st::expandedMenuSeparator);
|
||||||
}
|
}
|
||||||
{
|
|
||||||
auto item = base::make_unique_q<Ui::Menu::MultilineAction>(
|
|
||||||
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), [=] {
|
menu->addAction(tr::lng_sponsored_hide_ads(tr::now), [=] {
|
||||||
Settings::ShowPremium(controller, "no_ads");
|
Settings::ShowPremium(controller, "no_ads");
|
||||||
}, &st::menuIconBlock);
|
}, &st::menuIconCancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -2530,6 +2515,21 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
HistoryView::CopyPostLink(controller, itemId, HistoryView::Context::History);
|
HistoryView::CopyPostLink(controller, itemId, HistoryView::Context::History);
|
||||||
}, &st::menuIconLink);
|
}, &st::menuIconLink);
|
||||||
}
|
}
|
||||||
|
if (item && item->isSponsored()) {
|
||||||
|
_menu->addSeparator(&st::expandedMenuSeparator);
|
||||||
|
auto item = base::make_unique_q<Ui::Menu::MultilineAction>(
|
||||||
|
_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 (isUponSelected > 1) {
|
||||||
if (selectedState.count > 0 && selectedState.count == selectedState.canForwardCount) {
|
if (selectedState.count > 0 && selectedState.count == selectedState.canForwardCount) {
|
||||||
_menu->addAction(tr::lng_context_forward_selected(tr::now), [=] {
|
_menu->addAction(tr::lng_context_forward_selected(tr::now), [=] {
|
||||||
|
|
|
@ -1232,6 +1232,13 @@ msgServiceGiftBoxTitlePadding: margins(0px, 5px, 0px, 2px);
|
||||||
msgServiceGiftBoxStickerTop: -19px;
|
msgServiceGiftBoxStickerTop: -19px;
|
||||||
msgServiceGiftBoxStickerSize: size(140px, 140px);
|
msgServiceGiftBoxStickerSize: size(140px, 140px);
|
||||||
|
|
||||||
|
historySponsorInfoItem: FlatLabel(defaultFlatLabel) {
|
||||||
|
style: TextStyle(defaultTextStyle) {
|
||||||
|
font: font(12px);
|
||||||
|
}
|
||||||
|
minWidth: 136px;
|
||||||
|
maxHeight: 40px;
|
||||||
|
}
|
||||||
historyHasCustomEmoji: FlatLabel(defaultFlatLabel) {
|
historyHasCustomEmoji: FlatLabel(defaultFlatLabel) {
|
||||||
style: TextStyle(defaultTextStyle) {
|
style: TextStyle(defaultTextStyle) {
|
||||||
font: font(11px);
|
font: font(11px);
|
||||||
|
|
|
@ -103,6 +103,7 @@ menuIconPhotoSuggest: icon {{ "menu/photo_suggest", menuIconColor }};
|
||||||
menuIconNewWindow: icon {{ "menu/new_window", menuIconColor }};
|
menuIconNewWindow: icon {{ "menu/new_window", menuIconColor }};
|
||||||
menuIconChatBubble: icon {{ "menu/chat_bubble", menuIconColor }};
|
menuIconChatBubble: icon {{ "menu/chat_bubble", menuIconColor }};
|
||||||
menuIconPhone: icon {{ "menu/phone", menuIconColor }};
|
menuIconPhone: icon {{ "menu/phone", menuIconColor }};
|
||||||
|
menuIconChannel: icon {{ "menu/channel", menuIconColor }};
|
||||||
|
|
||||||
menuIconTTLAny: icon {{ "menu/auto_delete_plain", menuIconColor }};
|
menuIconTTLAny: icon {{ "menu/auto_delete_plain", menuIconColor }};
|
||||||
menuIconTTLAnyTextPosition: point(11px, 22px);
|
menuIconTTLAnyTextPosition: point(11px, 22px);
|
||||||
|
|