mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-29 13:39:06 +00:00
Attempt to fix the naturalWidth feature.
This commit is contained in:
parent
c939eda7bb
commit
b2fb2d5821
@ -215,43 +215,43 @@ void ConfirmSubscriptionBox(
|
|||||||
2.);
|
2.);
|
||||||
|
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
object_ptr<Ui::FlatLabel>(
|
tr::lng_channel_invite_subscription_title(),
|
||||||
box,
|
st::inviteLinkSubscribeBoxTitle),
|
||||||
tr::lng_channel_invite_subscription_title(),
|
st::boxRowPadding,
|
||||||
st::inviteLinkSubscribeBoxTitle)));
|
style::al_top);
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
object_ptr<Ui::FlatLabel>(
|
tr::lng_channel_invite_subscription_about(
|
||||||
box,
|
lt_channel,
|
||||||
tr::lng_channel_invite_subscription_about(
|
rpl::single(Ui::Text::Bold(name)),
|
||||||
lt_channel,
|
lt_price,
|
||||||
rpl::single(Ui::Text::Bold(name)),
|
tr::lng_credits_summary_options_credits(
|
||||||
lt_price,
|
lt_count,
|
||||||
tr::lng_credits_summary_options_credits(
|
rpl::single(amount) | tr::to_count(),
|
||||||
lt_count,
|
Ui::Text::Bold),
|
||||||
rpl::single(amount) | tr::to_count(),
|
Ui::Text::WithEntities),
|
||||||
Ui::Text::Bold),
|
st::inviteLinkSubscribeBoxAbout),
|
||||||
Ui::Text::WithEntities),
|
st::boxRowPadding,
|
||||||
st::inviteLinkSubscribeBoxAbout)));
|
style::al_top);
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
object_ptr<Ui::FlatLabel>(
|
tr::lng_channel_invite_subscription_terms(
|
||||||
box,
|
lt_link,
|
||||||
tr::lng_channel_invite_subscription_terms(
|
rpl::combine(
|
||||||
lt_link,
|
tr::lng_paid_react_agree_link(),
|
||||||
rpl::combine(
|
tr::lng_group_invite_subscription_about_url()
|
||||||
tr::lng_paid_react_agree_link(),
|
) | rpl::map([](const QString &text, const QString &url) {
|
||||||
tr::lng_group_invite_subscription_about_url()
|
return Ui::Text::Link(text, url);
|
||||||
) | rpl::map([](const QString &text, const QString &url) {
|
}),
|
||||||
return Ui::Text::Link(text, url);
|
Ui::Text::RichLangValue),
|
||||||
}),
|
st::inviteLinkSubscribeBoxTerms),
|
||||||
Ui::Text::RichLangValue),
|
st::boxRowPadding,
|
||||||
st::inviteLinkSubscribeBoxTerms)));
|
style::al_top);
|
||||||
|
|
||||||
{
|
{
|
||||||
const auto balance = Settings::AddBalanceWidget(
|
const auto balance = Settings::AddBalanceWidget(
|
||||||
|
@ -538,25 +538,24 @@ void LinkController::addHeader(not_null<Ui::VerticalLayout*> container) {
|
|||||||
|
|
||||||
const auto isStatic = _filterTitle.isStatic;
|
const auto isStatic = _filterTitle.isStatic;
|
||||||
verticalLayout->add(
|
verticalLayout->add(
|
||||||
object_ptr<Ui::CenterWrap<>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
verticalLayout,
|
verticalLayout,
|
||||||
object_ptr<Ui::FlatLabel>(
|
(_data.url.isEmpty()
|
||||||
verticalLayout,
|
? tr::lng_filters_link_no_about(Ui::Text::WithEntities)
|
||||||
(_data.url.isEmpty()
|
: tr::lng_filters_link_share_about(
|
||||||
? tr::lng_filters_link_no_about(Ui::Text::WithEntities)
|
lt_folder,
|
||||||
: tr::lng_filters_link_share_about(
|
rpl::single(Ui::Text::Wrapped(
|
||||||
lt_folder,
|
_filterTitle.text,
|
||||||
rpl::single(Ui::Text::Wrapped(
|
EntityType::Bold)),
|
||||||
_filterTitle.text,
|
Ui::Text::WithEntities)),
|
||||||
EntityType::Bold)),
|
st::settingsFilterDividerLabel,
|
||||||
Ui::Text::WithEntities)),
|
st::defaultPopupMenu,
|
||||||
st::settingsFilterDividerLabel,
|
Core::TextContext({
|
||||||
st::defaultPopupMenu,
|
.session = &_window->session(),
|
||||||
Core::TextContext({
|
.customEmojiLoopLimit = isStatic ? -1 : 0,
|
||||||
.session = &_window->session(),
|
})),
|
||||||
.customEmojiLoopLimit = isStatic ? -1 : 0,
|
st::filterLinkDividerLabelPadding,
|
||||||
}))),
|
style::al_top)->setTryMakeSimilarLines(true);
|
||||||
st::filterLinkDividerLabelPadding);
|
|
||||||
|
|
||||||
verticalLayout->geometryValue(
|
verticalLayout->geometryValue(
|
||||||
) | rpl::start_with_next([=](const QRect &r) {
|
) | rpl::start_with_next([=](const QRect &r) {
|
||||||
|
@ -78,19 +78,18 @@ void GiftCreditsBox(
|
|||||||
u"internal:stars_examples"_q);
|
u"internal:stars_examples"_q);
|
||||||
});
|
});
|
||||||
content->add(
|
content->add(
|
||||||
object_ptr<Ui::CenterWrap<>>(
|
Ui::CreateLabelWithCustomEmoji(
|
||||||
content,
|
content,
|
||||||
Ui::CreateLabelWithCustomEmoji(
|
tr::lng_credits_box_history_entry_gift_out_about(
|
||||||
content,
|
lt_user,
|
||||||
tr::lng_credits_box_history_entry_gift_out_about(
|
rpl::single(TextWithEntities{ peer->shortName() }),
|
||||||
lt_user,
|
lt_link,
|
||||||
rpl::single(TextWithEntities{ peer->shortName() }),
|
std::move(link),
|
||||||
lt_link,
|
Ui::Text::RichLangValue),
|
||||||
std::move(link),
|
Core::TextContext({ .session = &peer->session() }),
|
||||||
Ui::Text::RichLangValue),
|
st::creditsBoxAbout),
|
||||||
Core::TextContext({ .session = &peer->session() }),
|
st::boxRowPadding,
|
||||||
st::creditsBoxAbout)),
|
style::al_top);
|
||||||
st::boxRowPadding);
|
|
||||||
}
|
}
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
Ui::AddSkip(box->verticalLayout());
|
Ui::AddSkip(box->verticalLayout());
|
||||||
|
@ -741,7 +741,8 @@ void GiftCodeBox(
|
|||||||
std::move(shareLink),
|
std::move(shareLink),
|
||||||
Ui::Text::WithEntities)),
|
Ui::Text::WithEntities)),
|
||||||
st::giveawayGiftCodeFooter),
|
st::giveawayGiftCodeFooter),
|
||||||
st::giveawayGiftCodeFooterMargin);
|
st::giveawayGiftCodeFooterMargin,
|
||||||
|
style::al_top);
|
||||||
footer->setClickHandlerFilter([=](const auto &...) {
|
footer->setClickHandlerFilter([=](const auto &...) {
|
||||||
ShareWithFriend(controller, slug);
|
ShareWithFriend(controller, slug);
|
||||||
return false;
|
return false;
|
||||||
@ -883,7 +884,8 @@ void GiftCodePendingBox(
|
|||||||
box,
|
box,
|
||||||
tr::lng_gift_link_pending_footer(),
|
tr::lng_gift_link_pending_footer(),
|
||||||
st::giveawayGiftCodeFooter),
|
st::giveawayGiftCodeFooter),
|
||||||
st::giveawayGiftCodeFooterMargin);
|
st::giveawayGiftCodeFooterMargin,
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
const auto close = Ui::CreateChild<Ui::IconButton>(
|
const auto close = Ui::CreateChild<Ui::IconButton>(
|
||||||
box.get(),
|
box.get(),
|
||||||
@ -1186,7 +1188,8 @@ void GiveawayInfoBox(
|
|||||||
: tr::lng_prizes_cancelled()),
|
: tr::lng_prizes_cancelled()),
|
||||||
st::giveawayRefundedLabel),
|
st::giveawayRefundedLabel),
|
||||||
st::giveawayRefundedPadding),
|
st::giveawayRefundedPadding),
|
||||||
{ padding.left(), 0, padding.right(), padding.bottom() });
|
{ padding.left(), 0, padding.right(), padding.bottom() },
|
||||||
|
style::al_top);
|
||||||
const auto bg = wrap->lifetime().make_state<Ui::RoundRect>(
|
const auto bg = wrap->lifetime().make_state<Ui::RoundRect>(
|
||||||
st::boxRadius,
|
st::boxRadius,
|
||||||
st::attentionBoxButton.textBgOver);
|
st::attentionBoxButton.textBgOver);
|
||||||
|
@ -233,7 +233,8 @@ void FillUpgradeToPremiumCover(
|
|||||||
container,
|
container,
|
||||||
rpl::single(text),
|
rpl::single(text),
|
||||||
st::inviteForbiddenInfo),
|
st::inviteForbiddenInfo),
|
||||||
st::inviteForbiddenInfoPadding);
|
st::inviteForbiddenInfoPadding,
|
||||||
|
style::al_top);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleForbiddenBox(
|
void SimpleForbiddenBox(
|
||||||
@ -511,7 +512,8 @@ void InviteForbiddenController::setComplexCover() {
|
|||||||
if (_can) {
|
if (_can) {
|
||||||
container->add(
|
container->add(
|
||||||
MakeShowOrLabel(container, tr::lng_invite_upgrade_or()),
|
MakeShowOrLabel(container, tr::lng_invite_upgrade_or()),
|
||||||
st::inviteForbiddenOrLabelPadding);
|
st::inviteForbiddenOrLabelPadding,
|
||||||
|
style::al_top);
|
||||||
}
|
}
|
||||||
container->add(
|
container->add(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
@ -520,7 +522,8 @@ void InviteForbiddenController::setComplexCover() {
|
|||||||
? tr::lng_invite_upgrade_via_title()
|
? tr::lng_invite_upgrade_via_title()
|
||||||
: tr::lng_via_link_cant()),
|
: tr::lng_via_link_cant()),
|
||||||
st::inviteForbiddenTitle),
|
st::inviteForbiddenTitle),
|
||||||
st::inviteForbiddenTitlePadding);
|
st::inviteForbiddenTitlePadding,
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
const auto about = _can
|
const auto about = _can
|
||||||
? (_peer->isBroadcast()
|
? (_peer->isBroadcast()
|
||||||
@ -544,7 +547,8 @@ void InviteForbiddenController::setComplexCover() {
|
|||||||
container,
|
container,
|
||||||
rpl::single(about),
|
rpl::single(about),
|
||||||
st::inviteForbiddenInfo),
|
st::inviteForbiddenInfo),
|
||||||
st::inviteForbiddenInfoPadding);
|
st::inviteForbiddenInfoPadding,
|
||||||
|
style::al_top);
|
||||||
}
|
}
|
||||||
delegate()->peerListSetAboveWidget(std::move(cover));
|
delegate()->peerListSetAboveWidget(std::move(cover));
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,6 @@ public:
|
|||||||
bool selected);
|
bool selected);
|
||||||
|
|
||||||
[[nodiscard]] uint8 index() const;
|
[[nodiscard]] uint8 index() const;
|
||||||
int naturalWidth() const override;
|
|
||||||
|
|
||||||
void setSelected(bool selected);
|
void setSelected(bool selected);
|
||||||
|
|
||||||
@ -181,6 +180,15 @@ ColorSample::ColorSample(
|
|||||||
colorIndex
|
colorIndex
|
||||||
) | rpl::start_with_next([=](uint8 index) {
|
) | rpl::start_with_next([=](uint8 index) {
|
||||||
_index = index;
|
_index = index;
|
||||||
|
setNaturalWidth([&] {
|
||||||
|
if (_name.isEmpty() || _style->colorPatternIndex(_index)) {
|
||||||
|
return st::settingsColorSampleSize;
|
||||||
|
}
|
||||||
|
const auto padding = st::settingsColorSamplePadding;
|
||||||
|
return std::max(
|
||||||
|
padding.left() + _name.maxWidth() + padding.right(),
|
||||||
|
padding.top() + st::semiboldFont->height + padding.bottom());
|
||||||
|
}());
|
||||||
update();
|
update();
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
}
|
}
|
||||||
@ -195,6 +203,7 @@ ColorSample::ColorSample(
|
|||||||
, _index(colorIndex)
|
, _index(colorIndex)
|
||||||
, _selected(selected)
|
, _selected(selected)
|
||||||
, _simple(true) {
|
, _simple(true) {
|
||||||
|
setNaturalWidth(st::settingsColorSampleSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorSample::setSelected(bool selected) {
|
void ColorSample::setSelected(bool selected) {
|
||||||
@ -276,16 +285,6 @@ uint8 ColorSample::index() const {
|
|||||||
return _index;
|
return _index;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ColorSample::naturalWidth() const {
|
|
||||||
if (_name.isEmpty() || _style->colorPatternIndex(_index)) {
|
|
||||||
return st::settingsColorSampleSize;
|
|
||||||
}
|
|
||||||
const auto padding = st::settingsColorSamplePadding;
|
|
||||||
return std::max(
|
|
||||||
padding.left() + _name.maxWidth() + padding.right(),
|
|
||||||
padding.top() + st::semiboldFont->height + padding.bottom());
|
|
||||||
}
|
|
||||||
|
|
||||||
PreviewWrap::PreviewWrap(
|
PreviewWrap::PreviewWrap(
|
||||||
not_null<Ui::GenericBox*> box,
|
not_null<Ui::GenericBox*> box,
|
||||||
std::shared_ptr<Ui::ChatStyle> style,
|
std::shared_ptr<Ui::ChatStyle> style,
|
||||||
|
@ -976,21 +976,22 @@ void Controller::rowClicked(not_null<PeerListRow*> row) {
|
|||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
|
|
||||||
box->addRow(object_ptr<Ui::CenterWrap<>>(
|
box->addRow(
|
||||||
box,
|
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
tr::lng_credits_box_subscription_title(),
|
tr::lng_credits_box_subscription_title(),
|
||||||
st::creditsBoxAboutTitle)));
|
st::creditsBoxAboutTitle),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
|
|
||||||
const auto subtitle1 = box->addRow(
|
const auto subtitle1 = box->addRow(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
object_ptr<Ui::FlatLabel>(
|
st::creditsTopupPrice),
|
||||||
box,
|
st::boxRowPadding,
|
||||||
st::creditsTopupPrice)))->entity();
|
style::al_top);
|
||||||
subtitle1->setMarkedText(
|
subtitle1->setMarkedText(
|
||||||
tr::lng_credits_subscription_subtitle(
|
tr::lng_credits_subscription_subtitle(
|
||||||
tr::now,
|
tr::now,
|
||||||
@ -1027,8 +1028,7 @@ void Controller::rowClicked(not_null<PeerListRow*> row) {
|
|||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
|
|
||||||
box->addRow(object_ptr<Ui::CenterWrap<>>(
|
box->addRow(
|
||||||
box,
|
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
tr::lng_credits_box_out_about(
|
tr::lng_credits_box_out_about(
|
||||||
@ -1037,7 +1037,9 @@ void Controller::rowClicked(not_null<PeerListRow*> row) {
|
|||||||
) | Ui::Text::ToLink(
|
) | Ui::Text::ToLink(
|
||||||
tr::lng_credits_box_out_about_link(tr::now)),
|
tr::lng_credits_box_out_about_link(tr::now)),
|
||||||
Ui::Text::WithEntities),
|
Ui::Text::WithEntities),
|
||||||
st::creditsBoxAboutDivider)));
|
st::creditsBoxAboutDivider),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
const auto button = box->addButton(tr::lng_box_ok(), [=] {
|
const auto button = box->addButton(tr::lng_box_ok(), [=] {
|
||||||
box->closeBox();
|
box->closeBox();
|
||||||
|
@ -221,7 +221,8 @@ void Controller::prepare() {
|
|||||||
Ui::Text::RichLangValue),
|
Ui::Text::RichLangValue),
|
||||||
Ui::Text::RichLangValue),
|
Ui::Text::RichLangValue),
|
||||||
st::boostReassignText),
|
st::boostReassignText),
|
||||||
st::boxRowPadding);
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
delegate()->peerListSetAboveWidget(std::move(above));
|
delegate()->peerListSetAboveWidget(std::move(above));
|
||||||
|
|
||||||
const auto now = base::unixtime::now();
|
const auto now = base::unixtime::now();
|
||||||
|
@ -1079,26 +1079,21 @@ void PreviewBox(
|
|||||||
auto text = state->selected.value(
|
auto text = state->selected.value(
|
||||||
) | rpl::map(SectionAbout) | rpl::flatten_latest();
|
) | rpl::map(SectionAbout) | rpl::flatten_latest();
|
||||||
|
|
||||||
const auto padding = st::premiumPreviewAboutPadding;
|
|
||||||
const auto available = size.width() - padding.left() - padding.right();
|
|
||||||
auto titleLabel = object_ptr<Ui::FlatLabel>(
|
|
||||||
box,
|
|
||||||
std::move(title),
|
|
||||||
st::premiumPreviewAboutTitle);
|
|
||||||
titleLabel->resizeToWidth(available);
|
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
std::move(titleLabel)),
|
std::move(title),
|
||||||
st::premiumPreviewAboutTitlePadding);
|
st::premiumPreviewAboutTitle),
|
||||||
auto textLabel = object_ptr<Ui::FlatLabel>(
|
st::premiumPreviewAboutTitlePadding,
|
||||||
box,
|
style::al_top);
|
||||||
std::move(text),
|
|
||||||
st::premiumPreviewAbout);
|
|
||||||
textLabel->resizeToWidth(available);
|
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(box, std::move(textLabel)),
|
object_ptr<Ui::FlatLabel>(
|
||||||
padding);
|
box,
|
||||||
|
std::move(text),
|
||||||
|
st::premiumPreviewAbout),
|
||||||
|
st::premiumPreviewAboutPadding,
|
||||||
|
style::al_top
|
||||||
|
)->setTryMakeSimilarLines(true);
|
||||||
box->addRow(
|
box->addRow(
|
||||||
CreateSwitch(box->verticalLayout(), &state->selected, state->order),
|
CreateSwitch(box->verticalLayout(), &state->selected, state->order),
|
||||||
st::premiumDotsMargin);
|
st::premiumDotsMargin);
|
||||||
|
@ -364,14 +364,15 @@ void SendCreditsBox(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
box->addRow(object_ptr<Ui::CenterWrap<>>(
|
box->addRow(
|
||||||
box,
|
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
form->invoice.subscriptionPeriod
|
form->invoice.subscriptionPeriod
|
||||||
? rpl::single(form->title)
|
? rpl::single(form->title)
|
||||||
: tr::lng_credits_box_out_title(),
|
: tr::lng_credits_box_out_title(),
|
||||||
st::settingsPremiumUserTitle)));
|
st::settingsPremiumUserTitle),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
if (form->invoice.subscriptionPeriod && form->botId && form->photo) {
|
if (form->invoice.subscriptionPeriod && form->botId && form->photo) {
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
@ -383,12 +384,13 @@ void SendCreditsBox(
|
|||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
}
|
}
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
box->addRow(object_ptr<Ui::CenterWrap<>>(
|
box->addRow(
|
||||||
box,
|
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
SendCreditsConfirmText(session, form.get()),
|
SendCreditsConfirmText(session, form.get()),
|
||||||
st::creditsBoxAbout)));
|
st::creditsBoxAbout),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
|
|
||||||
|
@ -2981,13 +2981,15 @@ void AddBlock(
|
|||||||
content,
|
content,
|
||||||
std::move(args.subtitle),
|
std::move(args.subtitle),
|
||||||
st::giftBoxSubtitle),
|
st::giftBoxSubtitle),
|
||||||
st::giftBoxSubtitleMargin);
|
st::giftBoxSubtitleMargin,
|
||||||
|
style::al_top);
|
||||||
const auto about = content->add(
|
const auto about = content->add(
|
||||||
object_ptr<FlatLabel>(
|
object_ptr<FlatLabel>(
|
||||||
content,
|
content,
|
||||||
std::move(args.about),
|
std::move(args.about),
|
||||||
st::giftBoxAbout),
|
st::giftBoxAbout),
|
||||||
st::giftBoxAboutMargin);
|
st::giftBoxAboutMargin,
|
||||||
|
style::al_top);
|
||||||
about->setClickHandlerFilter(std::move(args.aboutFilter));
|
about->setClickHandlerFilter(std::move(args.aboutFilter));
|
||||||
content->add(std::move(args.content));
|
content->add(std::move(args.content));
|
||||||
}
|
}
|
||||||
@ -4381,13 +4383,15 @@ void ShowUniqueGiftWearBox(
|
|||||||
lt_name,
|
lt_name,
|
||||||
rpl::single(UniqueGiftName(gift))),
|
rpl::single(UniqueGiftName(gift))),
|
||||||
st.title ? *st.title : st::uniqueGiftTitle),
|
st.title ? *st.title : st::uniqueGiftTitle),
|
||||||
st::settingsPremiumRowTitlePadding);
|
st::settingsPremiumRowTitlePadding,
|
||||||
|
style::al_top);
|
||||||
content->add(
|
content->add(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
content,
|
content,
|
||||||
tr::lng_gift_wear_about(),
|
tr::lng_gift_wear_about(),
|
||||||
st.subtitle ? *st.subtitle : st::uniqueGiftSubtitle),
|
st.subtitle ? *st.subtitle : st::uniqueGiftSubtitle),
|
||||||
st::settingsPremiumRowAboutPadding);
|
st::settingsPremiumRowAboutPadding,
|
||||||
|
style::al_top);
|
||||||
infoRow(
|
infoRow(
|
||||||
tr::lng_gift_wear_badge_title(),
|
tr::lng_gift_wear_badge_title(),
|
||||||
(channel
|
(channel
|
||||||
|
@ -136,7 +136,8 @@ void ConferenceCallJoinConfirm(
|
|||||||
Ui::Text::RichLangValue)
|
Ui::Text::RichLangValue)
|
||||||
: tr::lng_confcall_join_text(Ui::Text::RichLangValue)),
|
: tr::lng_confcall_join_text(Ui::Text::RichLangValue)),
|
||||||
st::confcallLinkCenteredText),
|
st::confcallLinkCenteredText),
|
||||||
st::boxRowPadding
|
st::boxRowPadding,
|
||||||
|
style::al_top
|
||||||
)->setTryMakeSimilarLines(true);
|
)->setTryMakeSimilarLines(true);
|
||||||
|
|
||||||
const auto &participants = call->participants();
|
const auto &participants = call->participants();
|
||||||
@ -209,7 +210,8 @@ void ConferenceCallJoinConfirm(
|
|||||||
box,
|
box,
|
||||||
std::move(text),
|
std::move(text),
|
||||||
st::confcallLinkCenteredText),
|
st::confcallLinkCenteredText),
|
||||||
st::boxRowPadding
|
st::boxRowPadding,
|
||||||
|
style::al_top
|
||||||
)->setTryMakeSimilarLines(true);
|
)->setTryMakeSimilarLines(true);
|
||||||
}
|
}
|
||||||
const auto joinAndClose = [=] {
|
const auto joinAndClose = [=] {
|
||||||
@ -335,7 +337,8 @@ void ShowConferenceCallLinkBox(
|
|||||||
(st.centerLabel
|
(st.centerLabel
|
||||||
? *st.centerLabel
|
? *st.centerLabel
|
||||||
: st::confcallLinkCenteredText)),
|
: st::confcallLinkCenteredText)),
|
||||||
st::boxRowPadding
|
st::boxRowPadding,
|
||||||
|
style::al_top
|
||||||
)->setTryMakeSimilarLines(true);
|
)->setTryMakeSimilarLines(true);
|
||||||
|
|
||||||
Ui::AddSkip(box->verticalLayout(), st::defaultVerticalListSkip * 2);
|
Ui::AddSkip(box->verticalLayout(), st::defaultVerticalListSkip * 2);
|
||||||
|
@ -1054,7 +1054,8 @@ not_null<Ui::RpWidget*> CreateReActivateHeader(not_null<QWidget*> parent) {
|
|||||||
result,
|
result,
|
||||||
tr::lng_confcall_inactive_about(),
|
tr::lng_confcall_inactive_about(),
|
||||||
st::confcallLinkCenteredText),
|
st::confcallLinkCenteredText),
|
||||||
st::boxRowPadding + st::confcallLinkTitlePadding
|
st::boxRowPadding + st::confcallLinkTitlePadding,
|
||||||
|
style::al_top
|
||||||
)->setTryMakeSimilarLines(true);
|
)->setTryMakeSimilarLines(true);
|
||||||
Ui::AddDivider(result);
|
Ui::AddDivider(result);
|
||||||
|
|
||||||
|
@ -196,22 +196,13 @@ void RecordingInfo::prepareVideo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RecordingInfo::setLabel(const QString &text) {
|
void RecordingInfo::setLabel(const QString &text) {
|
||||||
const auto label = _container->add(
|
_container->add(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
_container,
|
_container,
|
||||||
text,
|
text,
|
||||||
st::groupCallRecordingSubLabel),
|
st::groupCallRecordingSubLabel),
|
||||||
st::groupCallRecordingSubLabelMargins);
|
st::groupCallRecordingSubLabelMargins,
|
||||||
|
style::al_top);
|
||||||
rpl::combine(
|
|
||||||
sizeValue(),
|
|
||||||
label->sizeValue()
|
|
||||||
) | rpl::start_with_next([=](QSize my, QSize labelSize) {
|
|
||||||
label->moveToLeft(
|
|
||||||
(my.width() - labelSize.width()) / 2,
|
|
||||||
label->y(),
|
|
||||||
my.width());
|
|
||||||
}, label->lifetime());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordingType RecordingInfo::type() const {
|
RecordingType RecordingInfo::type() const {
|
||||||
|
@ -1467,7 +1467,8 @@ void FrozenInfoBox(
|
|||||||
content,
|
content,
|
||||||
tr::lng_frozen_title(),
|
tr::lng_frozen_title(),
|
||||||
st.title ? *st.title : st::uniqueGiftTitle),
|
st.title ? *st.title : st::uniqueGiftTitle),
|
||||||
st::settingsPremiumRowTitlePadding);
|
st::settingsPremiumRowTitlePadding,
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
Ui::AddSkip(content, st::defaultVerticalListSkip * 3);
|
Ui::AddSkip(content, st::defaultVerticalListSkip * 3);
|
||||||
|
|
||||||
|
@ -4147,14 +4147,15 @@ void InnerWidget::refreshEmpty() {
|
|||||||
.name = u"no_chats"_q,
|
.name = u"no_chats"_q,
|
||||||
.sizeOverride = Size(st::changePhoneIconSize),
|
.sizeOverride = Size(st::changePhoneIconSize),
|
||||||
});
|
});
|
||||||
_emptyList->add(
|
_emptyList->add(std::move(icon.widget), {}, style::al_top);
|
||||||
object_ptr<Ui::CenterWrap<>>(_emptyList, std::move(icon.widget)));
|
|
||||||
Ui::AddSkip(_emptyList);
|
Ui::AddSkip(_emptyList);
|
||||||
_emptyList->add(
|
_emptyList->add(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
_emptyList,
|
_emptyList,
|
||||||
tr::lng_no_conversations(),
|
tr::lng_no_conversations(),
|
||||||
st::dialogEmptyButtonLabel));
|
st::dialogEmptyButtonLabel),
|
||||||
|
{},
|
||||||
|
style::al_top);
|
||||||
if (_state == WidgetState::Default) {
|
if (_state == WidgetState::Default) {
|
||||||
icon.animate(anim::repeat::once);
|
icon.animate(anim::repeat::once);
|
||||||
}
|
}
|
||||||
|
@ -170,30 +170,32 @@ void PostsSearchIntro::setup() {
|
|||||||
_content.get(),
|
_content.get(),
|
||||||
std::move(title),
|
std::move(title),
|
||||||
st::postsSearchIntroTitle),
|
st::postsSearchIntroTitle),
|
||||||
st::postsSearchIntroTitleMargin);
|
st::postsSearchIntroTitleMargin,
|
||||||
|
style::al_top);
|
||||||
_title->setTryMakeSimilarLines(true);
|
_title->setTryMakeSimilarLines(true);
|
||||||
_subtitle = _content->add(
|
_subtitle = _content->add(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
_content.get(),
|
_content.get(),
|
||||||
std::move(subtitle),
|
std::move(subtitle),
|
||||||
st::postsSearchIntroSubtitle),
|
st::postsSearchIntroSubtitle),
|
||||||
st::postsSearchIntroSubtitleMargin);
|
st::postsSearchIntroSubtitleMargin,
|
||||||
|
style::al_top);
|
||||||
_subtitle->setTryMakeSimilarLines(true);
|
_subtitle->setTryMakeSimilarLines(true);
|
||||||
_button = _content->add(
|
_button = _content->add(
|
||||||
object_ptr<Ui::CenterWrap<Ui::RoundButton>>(
|
object_ptr<Ui::RoundButton>(
|
||||||
_content.get(),
|
_content.get(),
|
||||||
object_ptr<Ui::RoundButton>(
|
rpl::single(QString()),
|
||||||
_content.get(),
|
st::postsSearchIntroButton),
|
||||||
rpl::single(QString()),
|
{},
|
||||||
st::postsSearchIntroButton))
|
style::al_top);
|
||||||
)->entity();
|
|
||||||
_button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
|
_button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
|
||||||
_footer = _content->add(
|
_footer = _content->add(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
_content.get(),
|
_content.get(),
|
||||||
std::move(footer),
|
std::move(footer),
|
||||||
st::postsSearchIntroFooter),
|
st::postsSearchIntroFooter),
|
||||||
st::postsSearchIntroFooterMargin);
|
st::postsSearchIntroFooterMargin,
|
||||||
|
style::al_top);
|
||||||
_footer->setTryMakeSimilarLines(true);
|
_footer->setTryMakeSimilarLines(true);
|
||||||
|
|
||||||
_state.value(
|
_state.value(
|
||||||
|
@ -389,12 +389,13 @@ void ChooseSuggestPriceBox(
|
|||||||
box->setNoContentMargin(true);
|
box->setNoContentMargin(true);
|
||||||
|
|
||||||
Ui::AddSkip(container, st::boxTitleHeight * 1.1);
|
Ui::AddSkip(container, st::boxTitleHeight * 1.1);
|
||||||
box->addRow(object_ptr<Ui::CenterWrap<>>(
|
box->addRow(
|
||||||
box,
|
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
std::move(title),
|
std::move(title),
|
||||||
st::settingsPremiumUserTitle)));
|
st::settingsPremiumUserTitle),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
}
|
}
|
||||||
|
|
||||||
state->buttons.push_back({
|
state->buttons.push_back({
|
||||||
@ -667,7 +668,7 @@ void ChooseSuggestPriceBox(
|
|||||||
return tr::lng_suggest_options_offer(
|
return tr::lng_suggest_options_offer(
|
||||||
tr::now,
|
tr::now,
|
||||||
lt_amount,
|
lt_amount,
|
||||||
TextWithEntities{ coloredTonIcon }.append(
|
Ui::Text::IconEmoji(&st::tonIconEmoji).append(
|
||||||
Lang::FormatCreditsAmountDecimal(price)),
|
Lang::FormatCreditsAmountDecimal(price)),
|
||||||
Ui::Text::WithEntities);
|
Ui::Text::WithEntities);
|
||||||
}
|
}
|
||||||
@ -786,19 +787,19 @@ void InsufficientTonBox(
|
|||||||
const auto nano = add.whole() * Ui::kNanosInOne + add.nano();
|
const auto nano = add.whole() * Ui::kNanosInOne + add.nano();
|
||||||
const auto amount = Ui::FormatTonAmount(nano).full;
|
const auto amount = Ui::FormatTonAmount(nano).full;
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
object_ptr<Ui::FlatLabel>(
|
tr::lng_suggest_low_ton_title(tr::now, lt_amount, amount),
|
||||||
box,
|
st::boxTitle),
|
||||||
tr::lng_suggest_low_ton_title(tr::now, lt_amount, amount),
|
st::boxRowPadding + st::lowTonTitlePadding,
|
||||||
st::boxTitle)),
|
style::al_top);
|
||||||
st::boxRowPadding + st::lowTonTitlePadding);
|
|
||||||
const auto label = box->addRow(
|
const auto label = box->addRow(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
tr::lng_suggest_low_ton_text(Ui::Text::RichLangValue),
|
tr::lng_suggest_low_ton_text(Ui::Text::RichLangValue),
|
||||||
st::lowTonText),
|
st::lowTonText),
|
||||||
st::boxRowPadding + st::lowTonTextPadding);
|
st::boxRowPadding + st::lowTonTextPadding,
|
||||||
|
style::al_top);
|
||||||
label->setTryMakeSimilarLines(true);
|
label->setTryMakeSimilarLines(true);
|
||||||
label->resizeToWidth(
|
label->resizeToWidth(
|
||||||
st::boxWidth - st::boxRowPadding.left() - st::boxRowPadding.right());
|
st::boxWidth - st::boxRowPadding.left() - st::boxRowPadding.right());
|
||||||
|
@ -354,19 +354,22 @@ void ShowAgeVerification(
|
|||||||
box,
|
box,
|
||||||
tr::lng_age_verify_title(),
|
tr::lng_age_verify_title(),
|
||||||
st::settingsAgeVerifyTitle),
|
st::settingsAgeVerifyTitle),
|
||||||
st::boxRowPadding + st::settingsAgeVerifyMargin);
|
st::boxRowPadding + st::settingsAgeVerifyMargin,
|
||||||
|
style::al_top);
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
AgeVerifyAbout(&bot->session()),
|
AgeVerifyAbout(&bot->session()),
|
||||||
st::settingsAgeVerifyText),
|
st::settingsAgeVerifyText),
|
||||||
st::boxRowPadding + st::settingsAgeVerifyMargin);
|
st::boxRowPadding + st::settingsAgeVerifyMargin,
|
||||||
|
style::al_top);
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
tr::lng_age_verify_here(Ui::Text::RichLangValue),
|
tr::lng_age_verify_here(Ui::Text::RichLangValue),
|
||||||
st::settingsAgeVerifyText),
|
st::settingsAgeVerifyText),
|
||||||
st::boxRowPadding + st::settingsAgeVerifyMargin);
|
st::boxRowPadding + st::settingsAgeVerifyMargin,
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
const auto weak = QPointer<Ui::GenericBox>(box);
|
const auto weak = QPointer<Ui::GenericBox>(box);
|
||||||
const auto done = crl::guard(&bot->session(), [=](int age) {
|
const auto done = crl::guard(&bot->session(), [=](int age) {
|
||||||
@ -446,13 +449,15 @@ void ShowAgeVerificationMobile(
|
|||||||
box,
|
box,
|
||||||
AgeVerifyAbout(session),
|
AgeVerifyAbout(session),
|
||||||
st::settingsAgeVerifyText),
|
st::settingsAgeVerifyText),
|
||||||
st::boxRowPadding + st::settingsAgeVerifyMargin);
|
st::boxRowPadding + st::settingsAgeVerifyMargin,
|
||||||
|
style::al_top);
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
tr::lng_age_verify_mobile(Ui::Text::RichLangValue),
|
tr::lng_age_verify_mobile(Ui::Text::RichLangValue),
|
||||||
st::settingsAgeVerifyText),
|
st::settingsAgeVerifyText),
|
||||||
st::boxRowPadding + st::settingsAgeVerifyMargin);
|
st::boxRowPadding + st::settingsAgeVerifyMargin,
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
box->addButton(tr::lng_box_ok(), [=] {
|
box->addButton(tr::lng_box_ok(), [=] {
|
||||||
box->closeBox();
|
box->closeBox();
|
||||||
|
@ -470,7 +470,8 @@ object_ptr<Ui::BoxContent> StarRefLinkBox(
|
|||||||
FormatForProgramDuration(program.durationMonths),
|
FormatForProgramDuration(program.durationMonths),
|
||||||
Ui::Text::WithEntities),
|
Ui::Text::WithEntities),
|
||||||
st::starrefCenteredText),
|
st::starrefCenteredText),
|
||||||
st::boxRowPadding);
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
Ui::AddSkip(box->verticalLayout(), st::defaultVerticalListSkip * 3);
|
Ui::AddSkip(box->verticalLayout(), st::defaultVerticalListSkip * 3);
|
||||||
|
|
||||||
@ -478,7 +479,9 @@ object_ptr<Ui::BoxContent> StarRefLinkBox(
|
|||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
tr::lng_star_ref_link_recipient(),
|
tr::lng_star_ref_link_recipient(),
|
||||||
st::starrefCenteredText));
|
st::starrefCenteredText),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
Ui::AddSkip(box->verticalLayout());
|
Ui::AddSkip(box->verticalLayout());
|
||||||
box->addRow(object_ptr<Ui::AbstractButton>::fromRaw(
|
box->addRow(object_ptr<Ui::AbstractButton>::fromRaw(
|
||||||
MakePeerBubbleButton(box, peer).release()
|
MakePeerBubbleButton(box, peer).release()
|
||||||
@ -596,7 +599,8 @@ object_ptr<Ui::BoxContent> JoinStarRefBox(
|
|||||||
FormatForProgramDuration(program.durationMonths),
|
FormatForProgramDuration(program.durationMonths),
|
||||||
Ui::Text::WithEntities),
|
Ui::Text::WithEntities),
|
||||||
st::starrefCenteredText),
|
st::starrefCenteredText),
|
||||||
st::boxRowPadding);
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
Ui::AddSkip(box->verticalLayout(), st::defaultVerticalListSkip * 3);
|
Ui::AddSkip(box->verticalLayout(), st::defaultVerticalListSkip * 3);
|
||||||
if (const auto average = program.revenuePerUser) {
|
if (const auto average = program.revenuePerUser) {
|
||||||
@ -613,7 +617,8 @@ object_ptr<Ui::BoxContent> JoinStarRefBox(
|
|||||||
Ui::Text::WithEntities),
|
Ui::Text::WithEntities),
|
||||||
st::starrefRevenueText,
|
st::starrefRevenueText,
|
||||||
st::defaultPopupMenu),
|
st::defaultPopupMenu),
|
||||||
st::boxRowPadding);
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
Ui::AddSkip(layout, st::defaultVerticalListSkip);
|
Ui::AddSkip(layout, st::defaultVerticalListSkip);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -635,7 +640,9 @@ object_ptr<Ui::BoxContent> JoinStarRefBox(
|
|||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
tr::lng_star_ref_link_recipient(),
|
tr::lng_star_ref_link_recipient(),
|
||||||
st::starrefCenteredText));
|
st::starrefCenteredText),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
Ui::AddSkip(box->verticalLayout());
|
Ui::AddSkip(box->verticalLayout());
|
||||||
const auto recipientWrap = box->addRow(
|
const auto recipientWrap = box->addRow(
|
||||||
object_ptr<Ui::VerticalLayout>(box),
|
object_ptr<Ui::VerticalLayout>(box),
|
||||||
|
@ -829,7 +829,7 @@ rpl::producer<int> WrapWidget::desiredHeightValue() const {
|
|||||||
|
|
||||||
QRect WrapWidget::contentGeometry() const {
|
QRect WrapWidget::contentGeometry() const {
|
||||||
const auto top = _topBar ? _topBar->height() : 0;
|
const auto top = _topBar ? _topBar->height() : 0;
|
||||||
return rect().marginsRemoved({ 0, top, 0, 0 });
|
return rect().marginsRemoved({ 0, std::min(top, height()), 0, 0});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WrapWidget::returnToFirstStackFrame(
|
bool WrapWidget::returnToFirstStackFrame(
|
||||||
|
@ -1009,13 +1009,15 @@ void SelectGiftToUnpin(
|
|||||||
box,
|
box,
|
||||||
tr::lng_gift_many_pinned_title(),
|
tr::lng_gift_many_pinned_title(),
|
||||||
st::giftBoxSubtitle),
|
st::giftBoxSubtitle),
|
||||||
st::giftBoxSubtitleMargin);
|
st::giftBoxSubtitleMargin,
|
||||||
|
style::al_top);
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
tr::lng_gift_many_pinned_choose(),
|
tr::lng_gift_many_pinned_choose(),
|
||||||
st::giftTooManyPinnedChoose),
|
st::giftTooManyPinnedChoose),
|
||||||
st::giftBoxAboutMargin);
|
st::giftBoxAboutMargin,
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
const auto gifts = box->addRow(
|
const auto gifts = box->addRow(
|
||||||
object_ptr<Ui::RpWidget>(box),
|
object_ptr<Ui::RpWidget>(box),
|
||||||
|
@ -25,14 +25,10 @@ FloatingIcon::FloatingIcon(
|
|||||||
: RpWidget(parent)
|
: RpWidget(parent)
|
||||||
, _icon(&icon)
|
, _icon(&icon)
|
||||||
, _point(position) {
|
, _point(position) {
|
||||||
resize(
|
setGeometry(QRect(
|
||||||
_point.x() + _icon->width(),
|
QPoint(0, 0),
|
||||||
_point.y() + _icon->height());
|
QSize(_point.x() + _icon->width(), _point.y() + _icon->height())));
|
||||||
setAttribute(Qt::WA_TransparentForMouseEvents);
|
setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||||
parent->widthValue(
|
|
||||||
) | rpl::start_with_next(
|
|
||||||
[this] { moveToLeft(0, 0); },
|
|
||||||
lifetime());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FloatingIcon::paintEvent(QPaintEvent *e) {
|
void FloatingIcon::paintEvent(QPaintEvent *e) {
|
||||||
|
@ -131,7 +131,8 @@ void Widget::restoreState(not_null<Memento*> memento) {
|
|||||||
|
|
||||||
void Widget::refreshBottom() {
|
void Widget::refreshBottom() {
|
||||||
const auto albumId = _albumId.current();
|
const auto albumId = _albumId.current();
|
||||||
const auto withButton = albumId
|
const auto withButton = (albumId != Data::kStoriesAlbumIdSaved)
|
||||||
|
&& (albumId != Data::kStoriesAlbumIdArchive)
|
||||||
&& controller()->storiesPeer()->canEditStories();
|
&& controller()->storiesPeer()->canEditStories();
|
||||||
const auto wasBottom = _pinnedToBottom ? _pinnedToBottom->height() : 0;
|
const auto wasBottom = _pinnedToBottom ? _pinnedToBottom->height() : 0;
|
||||||
delete _pinnedToBottom.data();
|
delete _pinnedToBottom.data();
|
||||||
|
@ -511,15 +511,18 @@ void ConfirmEmojiStatusAccessBox(
|
|||||||
AddSkip(box->verticalLayout(), 2 * st::defaultVerticalListSkip);
|
AddSkip(box->verticalLayout(), 2 * st::defaultVerticalListSkip);
|
||||||
|
|
||||||
auto name = Ui::Text::Bold(bot->name());
|
auto name = Ui::Text::Bold(bot->name());
|
||||||
box->addRow(object_ptr<Ui::FlatLabel>(
|
box->addRow(
|
||||||
box,
|
object_ptr<Ui::FlatLabel>(
|
||||||
tr::lng_bot_emoji_status_access_text(
|
box,
|
||||||
lt_bot,
|
tr::lng_bot_emoji_status_access_text(
|
||||||
rpl::single(name),
|
lt_bot,
|
||||||
lt_name,
|
rpl::single(name),
|
||||||
rpl::single(name),
|
lt_name,
|
||||||
Ui::Text::RichLangValue),
|
rpl::single(name),
|
||||||
st::botEmojiStatusText));
|
Ui::Text::RichLangValue),
|
||||||
|
st::botEmojiStatusText),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
box->addButton(tr::lng_bot_emoji_status_access_allow(), [=] {
|
box->addButton(tr::lng_bot_emoji_status_access_allow(), [=] {
|
||||||
if (!CheckEmojiStatusPremium(bot)) {
|
if (!CheckEmojiStatusPremium(bot)) {
|
||||||
@ -557,19 +560,25 @@ void ConfirmEmojiStatusBox(
|
|||||||
box->closeBox();
|
box->closeBox();
|
||||||
});
|
});
|
||||||
|
|
||||||
box->addRow(object_ptr<Ui::FlatLabel>(
|
box->addRow(
|
||||||
box,
|
object_ptr<Ui::FlatLabel>(
|
||||||
tr::lng_bot_emoji_status_title(),
|
box,
|
||||||
st::botEmojiStatusTitle));
|
tr::lng_bot_emoji_status_title(),
|
||||||
|
st::botEmojiStatusTitle),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
AddSkip(box->verticalLayout());
|
AddSkip(box->verticalLayout());
|
||||||
|
|
||||||
box->addRow(object_ptr<Ui::FlatLabel>(
|
box->addRow(
|
||||||
box,
|
object_ptr<Ui::FlatLabel>(
|
||||||
tr::lng_bot_emoji_status_text(
|
box,
|
||||||
lt_bot,
|
tr::lng_bot_emoji_status_text(
|
||||||
rpl::single(Ui::Text::Bold(bot->name())),
|
lt_bot,
|
||||||
Ui::Text::RichLangValue),
|
rpl::single(Ui::Text::Bold(bot->name())),
|
||||||
st::botEmojiStatusText));
|
Ui::Text::RichLangValue),
|
||||||
|
st::botEmojiStatusText),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
AddSkip(box->verticalLayout(), 2 * st::defaultVerticalListSkip);
|
AddSkip(box->verticalLayout(), 2 * st::defaultVerticalListSkip);
|
||||||
|
|
||||||
|
@ -327,8 +327,11 @@ struct Feature {
|
|||||||
box->setWidth(st::boxWideWidth);
|
box->setWidth(st::boxWideWidth);
|
||||||
box->setStyle(st::storiesStealthBox);
|
box->setStyle(st::storiesStealthBox);
|
||||||
box->addRow(MakeLogo(box));
|
box->addRow(MakeLogo(box));
|
||||||
box->addRow(MakeTitle(box));
|
box->addRow(MakeTitle(box), st::boxRowPadding, style::al_top);
|
||||||
box->addRow(MakeAbout(box, data->state.value()));
|
box->addRow(
|
||||||
|
MakeAbout(box, data->state.value()),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
box->addRow(MakeFeature(box, FeaturePast()));
|
box->addRow(MakeFeature(box, FeaturePast()));
|
||||||
box->addRow(
|
box->addRow(
|
||||||
MakeFeature(box, FeatureNext()),
|
MakeFeature(box, FeatureNext()),
|
||||||
|
@ -81,22 +81,20 @@ not_null<Ui::RpWidget*> PanelForm::setupContent() {
|
|||||||
}, _userpic->lifetime());
|
}, _userpic->lifetime());
|
||||||
|
|
||||||
_about1 = inner->add(
|
_about1 = inner->add(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
inner,
|
inner,
|
||||||
object_ptr<Ui::FlatLabel>(
|
tr::lng_passport_request1(tr::now, lt_bot, bot->name()),
|
||||||
inner,
|
st::passportPasswordLabelBold),
|
||||||
tr::lng_passport_request1(tr::now, lt_bot, bot->name()),
|
st::passportFormAbout1Padding,
|
||||||
st::passportPasswordLabelBold)),
|
style::al_top);
|
||||||
st::passportFormAbout1Padding)->entity();
|
|
||||||
|
|
||||||
_about2 = inner->add(
|
_about2 = inner->add(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
inner,
|
inner,
|
||||||
object_ptr<Ui::FlatLabel>(
|
tr::lng_passport_request2(tr::now),
|
||||||
inner,
|
st::passportPasswordLabel),
|
||||||
tr::lng_passport_request2(tr::now),
|
st::passportFormAbout2Padding,
|
||||||
st::passportPasswordLabel)),
|
style::al_top);
|
||||||
st::passportFormAbout2Padding)->entity();
|
|
||||||
|
|
||||||
inner->add(object_ptr<Ui::BoxContentDivider>(
|
inner->add(object_ptr<Ui::BoxContentDivider>(
|
||||||
inner,
|
inner,
|
||||||
|
@ -171,25 +171,23 @@ void PanelNoPassword::setupContent() {
|
|||||||
}, _inner->lifetime());
|
}, _inner->lifetime());
|
||||||
|
|
||||||
_inner->add(
|
_inner->add(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
_inner,
|
_inner,
|
||||||
object_ptr<Ui::FlatLabel>(
|
tr::lng_passport_request1(
|
||||||
_inner,
|
tr::now,
|
||||||
tr::lng_passport_request1(
|
lt_bot,
|
||||||
tr::now,
|
_controller->bot()->name()),
|
||||||
lt_bot,
|
st::passportPasswordLabelBold),
|
||||||
_controller->bot()->name()),
|
st::passportPasswordAbout1Padding,
|
||||||
st::passportPasswordLabelBold)),
|
style::al_top);
|
||||||
st::passportPasswordAbout1Padding)->entity();
|
|
||||||
|
|
||||||
_inner->add(
|
_inner->add(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
_inner,
|
_inner,
|
||||||
object_ptr<Ui::FlatLabel>(
|
tr::lng_passport_request2(tr::now),
|
||||||
_inner,
|
st::passportPasswordLabel),
|
||||||
tr::lng_passport_request2(tr::now),
|
st::passportPasswordAbout2Padding,
|
||||||
st::passportPasswordLabel)),
|
style::al_top);
|
||||||
st::passportPasswordAbout2Padding)->entity();
|
|
||||||
|
|
||||||
const auto iconWrap = _inner->add(
|
const auto iconWrap = _inner->add(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FixedHeightWidget>>(
|
object_ptr<Ui::CenterWrap<Ui::FixedHeightWidget>>(
|
||||||
@ -204,13 +202,12 @@ void PanelNoPassword::setupContent() {
|
|||||||
QPoint(0, 0));
|
QPoint(0, 0));
|
||||||
|
|
||||||
_inner->add(
|
_inner->add(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
_inner,
|
_inner,
|
||||||
object_ptr<Ui::FlatLabel>(
|
tr::lng_passport_create_password(tr::now),
|
||||||
_inner,
|
st::passportPasswordSetupLabel),
|
||||||
tr::lng_passport_create_password(tr::now),
|
st::passportFormAbout2Padding,
|
||||||
st::passportPasswordSetupLabel)),
|
style::al_top);
|
||||||
st::passportFormAbout2Padding)->entity();
|
|
||||||
|
|
||||||
refreshBottom();
|
refreshBottom();
|
||||||
}
|
}
|
||||||
@ -218,15 +215,14 @@ void PanelNoPassword::setupContent() {
|
|||||||
void PanelNoPassword::refreshBottom() {
|
void PanelNoPassword::refreshBottom() {
|
||||||
const auto pattern = _controller->unconfirmedEmailPattern();
|
const auto pattern = _controller->unconfirmedEmailPattern();
|
||||||
_about.reset(_inner->add(
|
_about.reset(_inner->add(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
_inner,
|
_inner,
|
||||||
object_ptr<Ui::FlatLabel>(
|
(pattern.isEmpty()
|
||||||
_inner,
|
? tr::lng_passport_about_password(tr::now)
|
||||||
(pattern.isEmpty()
|
: tr::lng_passport_code_sent(tr::now, lt_email, pattern)),
|
||||||
? tr::lng_passport_about_password(tr::now)
|
st::passportPasswordSetupLabel),
|
||||||
: tr::lng_passport_code_sent(tr::now, lt_email, pattern)),
|
st::passportFormAbout2Padding,
|
||||||
st::passportPasswordSetupLabel)),
|
style::al_top));
|
||||||
st::passportFormAbout2Padding)->entity());
|
|
||||||
if (pattern.isEmpty()) {
|
if (pattern.isEmpty()) {
|
||||||
const auto button = _inner->add(
|
const auto button = _inner->add(
|
||||||
object_ptr<Ui::CenterWrap<Ui::RoundButton>>(
|
object_ptr<Ui::CenterWrap<Ui::RoundButton>>(
|
||||||
|
@ -119,10 +119,13 @@ bool FormSummary::showCriticalError(const TextWithEntities &text) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Ui::AddSkip(_layout.get(), st::paymentsPricesTopSkip);
|
Ui::AddSkip(_layout.get(), st::paymentsPricesTopSkip);
|
||||||
_layout->add(object_ptr<FlatLabel>(
|
_layout->add(
|
||||||
_layout.get(),
|
object_ptr<FlatLabel>(
|
||||||
rpl::single(text),
|
_layout.get(),
|
||||||
st::paymentsCriticalError));
|
rpl::single(text),
|
||||||
|
st::paymentsCriticalError),
|
||||||
|
{},
|
||||||
|
style::al_top);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -481,7 +481,8 @@ void PaidReactionsBox(
|
|||||||
box,
|
box,
|
||||||
tr::lng_paid_react_title(),
|
tr::lng_paid_react_title(),
|
||||||
st::boostCenteredTitle),
|
st::boostCenteredTitle),
|
||||||
st::boxRowPadding + QMargins(0, st::paidReactTitleSkip, 0, 0));
|
st::boxRowPadding + QMargins(0, st::paidReactTitleSkip, 0, 0),
|
||||||
|
style::al_top);
|
||||||
const auto labelWrap = box->addRow(
|
const auto labelWrap = box->addRow(
|
||||||
object_ptr<RpWidget>(box),
|
object_ptr<RpWidget>(box),
|
||||||
(st::boxRowPadding
|
(st::boxRowPadding
|
||||||
|
@ -302,7 +302,7 @@ settingsAccentColorSkip: 4px;
|
|||||||
settingsAccentColorLine: 3px;
|
settingsAccentColorLine: 3px;
|
||||||
|
|
||||||
settingsFilterDividerLabel: FlatLabel(boxDividerLabel) {
|
settingsFilterDividerLabel: FlatLabel(boxDividerLabel) {
|
||||||
minWidth: 258px;
|
minWidth: 200px;
|
||||||
maxHeight: 0px;
|
maxHeight: 0px;
|
||||||
align: align(top);
|
align: align(top);
|
||||||
}
|
}
|
||||||
|
@ -186,22 +186,20 @@ void Blocked::setupContent() {
|
|||||||
}, content->lifetime());
|
}, content->lifetime());
|
||||||
|
|
||||||
content->add(
|
content->add(
|
||||||
object_ptr<Ui::CenterWrap<>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
content,
|
content,
|
||||||
object_ptr<Ui::FlatLabel>(
|
tr::lng_blocked_list_empty_title(),
|
||||||
content,
|
st::changePhoneTitle),
|
||||||
tr::lng_blocked_list_empty_title(),
|
st::changePhoneTitlePadding,
|
||||||
st::changePhoneTitle)),
|
style::al_top);
|
||||||
st::changePhoneTitlePadding);
|
|
||||||
|
|
||||||
content->add(
|
content->add(
|
||||||
object_ptr<Ui::CenterWrap<>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
content,
|
content,
|
||||||
object_ptr<Ui::FlatLabel>(
|
tr::lng_blocked_list_empty_description(),
|
||||||
content,
|
st::changePhoneDescription),
|
||||||
tr::lng_blocked_list_empty_description(),
|
st::changePhoneDescriptionPadding,
|
||||||
st::changePhoneDescription)),
|
style::al_top);
|
||||||
st::changePhoneDescriptionPadding);
|
|
||||||
|
|
||||||
Ui::AddSkip(content, st::settingsBlockedListIconPadding.top());
|
Ui::AddSkip(content, st::settingsBlockedListIconPadding.top());
|
||||||
}
|
}
|
||||||
|
@ -227,14 +227,13 @@ void AddDividerTextWithLottie(
|
|||||||
|
|
||||||
if (descriptor.about) {
|
if (descriptor.about) {
|
||||||
verticalLayout->add(
|
verticalLayout->add(
|
||||||
object_ptr<Ui::CenterWrap<>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
verticalLayout,
|
verticalLayout,
|
||||||
object_ptr<Ui::FlatLabel>(
|
std::move(descriptor.about),
|
||||||
verticalLayout,
|
st::settingsFilterDividerLabel),
|
||||||
std::move(descriptor.about),
|
|
||||||
st::settingsFilterDividerLabel)),
|
|
||||||
descriptor.aboutMargins.value_or(
|
descriptor.aboutMargins.value_or(
|
||||||
st::settingsFilterDividerLabelPadding));
|
st::settingsFilterDividerLabelPadding),
|
||||||
|
style::al_top)->setTryMakeSimilarLines(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
verticalLayout->geometryValue(
|
verticalLayout->geometryValue(
|
||||||
|
@ -853,8 +853,7 @@ void BoostCreditsBox(
|
|||||||
AddCreditsBoostTable(controller->uiShow(), content, {}, b);
|
AddCreditsBoostTable(controller->uiShow(), content, {}, b);
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
|
|
||||||
box->addRow(object_ptr<Ui::CenterWrap<>>(
|
box->addRow(
|
||||||
box,
|
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
tr::lng_credits_box_out_about(
|
tr::lng_credits_box_out_about(
|
||||||
@ -863,7 +862,9 @@ void BoostCreditsBox(
|
|||||||
) | Ui::Text::ToLink(
|
) | Ui::Text::ToLink(
|
||||||
tr::lng_credits_box_out_about_link(tr::now)),
|
tr::lng_credits_box_out_about_link(tr::now)),
|
||||||
Ui::Text::WithEntities),
|
Ui::Text::WithEntities),
|
||||||
st::creditsBoxAboutDivider)));
|
st::creditsBoxAboutDivider),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
|
|
||||||
const auto button = box->addButton(tr::lng_box_ok(), [=] {
|
const auto button = box->addButton(tr::lng_box_ok(), [=] {
|
||||||
@ -1391,8 +1392,7 @@ void GenericCreditsEntryBox(
|
|||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
|
|
||||||
box->addRow(object_ptr<Ui::CenterWrap<>>(
|
box->addRow(
|
||||||
box,
|
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
rpl::single(!s.title.isEmpty()
|
rpl::single(!s.title.isEmpty()
|
||||||
@ -1434,7 +1434,9 @@ void GenericCreditsEntryBox(
|
|||||||
: (peer && !e.reaction)
|
: (peer && !e.reaction)
|
||||||
? peer->name()
|
? peer->name()
|
||||||
: Ui::GenerateEntryName(e).text),
|
: Ui::GenerateEntryName(e).text),
|
||||||
st::creditsBoxAboutTitle)));
|
st::creditsBoxAboutTitle),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
}
|
}
|
||||||
@ -1607,68 +1609,69 @@ void GenericCreditsEntryBox(
|
|||||||
|
|
||||||
if (!isStarGift && !e.description.empty()) {
|
if (!isStarGift && !e.description.empty()) {
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
box->addRow(object_ptr<Ui::CenterWrap<>>(
|
box->addRow(
|
||||||
box,
|
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
rpl::single(e.description),
|
rpl::single(e.description),
|
||||||
st::creditsBoxAbout)));
|
st::creditsBoxAbout),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto arrow = Ui::Text::IconEmoji(&st::textMoreIconEmoji);
|
const auto arrow = Ui::Text::IconEmoji(&st::textMoreIconEmoji);
|
||||||
if (!uniqueGift && (starGiftCanManage || e.converted)) {
|
if (!uniqueGift && (starGiftCanManage || e.converted)) {
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
const auto about = box->addRow(
|
const auto about = box->addRow(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
object_ptr<Ui::FlatLabel>(
|
(e.giftRefunded
|
||||||
box,
|
? tr::lng_action_gift_refunded(
|
||||||
(e.giftRefunded
|
Ui::Text::RichLangValue)
|
||||||
? tr::lng_action_gift_refunded(
|
: e.starsUpgradedBySender
|
||||||
Ui::Text::RichLangValue)
|
? tr::lng_action_gift_got_upgradable_text(
|
||||||
: e.starsUpgradedBySender
|
Ui::Text::RichLangValue)
|
||||||
? tr::lng_action_gift_got_upgradable_text(
|
: (e.starsToUpgrade
|
||||||
Ui::Text::RichLangValue)
|
&& giftToSelf
|
||||||
: (e.starsToUpgrade
|
&& !e.giftTransferred)
|
||||||
&& giftToSelf
|
? tr::lng_action_gift_self_about_unique(
|
||||||
&& !e.giftTransferred)
|
Ui::Text::WithEntities)
|
||||||
? tr::lng_action_gift_self_about_unique(
|
: (e.starsToUpgrade
|
||||||
Ui::Text::WithEntities)
|
&& giftToChannelCanManage
|
||||||
: (e.starsToUpgrade
|
&& !e.giftTransferred)
|
||||||
&& giftToChannelCanManage
|
? tr::lng_action_gift_channel_about_unique(
|
||||||
&& !e.giftTransferred)
|
Ui::Text::WithEntities)
|
||||||
? tr::lng_action_gift_channel_about_unique(
|
: ((canConvert || e.converted)
|
||||||
Ui::Text::WithEntities)
|
? rpl::combine(
|
||||||
: ((canConvert || e.converted)
|
(canConvert
|
||||||
? rpl::combine(
|
? (giftToSelf
|
||||||
(canConvert
|
? tr::lng_action_gift_self_about
|
||||||
? (giftToSelf
|
: giftToChannelCanTransfer
|
||||||
? tr::lng_action_gift_self_about
|
? tr::lng_action_gift_channel_about
|
||||||
: giftToChannelCanTransfer
|
: tr::lng_action_gift_got_stars_text)
|
||||||
? tr::lng_action_gift_channel_about
|
|
||||||
: tr::lng_action_gift_got_stars_text)
|
|
||||||
: (giftToChannel
|
|
||||||
? tr::lng_gift_channel_got
|
|
||||||
: tr::lng_gift_got_stars))(
|
|
||||||
lt_count,
|
|
||||||
rpl::single(e.starsConverted * 1.),
|
|
||||||
Ui::Text::RichLangValue),
|
|
||||||
tr::lng_paid_about_link()
|
|
||||||
) | rpl::map([](
|
|
||||||
TextWithEntities text,
|
|
||||||
QString link) {
|
|
||||||
return text.append(' ').append(
|
|
||||||
Ui::Text::Link(link));
|
|
||||||
})
|
|
||||||
: (e.savedToProfile
|
|
||||||
? (giftToChannel
|
|
||||||
? tr::lng_action_gift_can_remove_channel
|
|
||||||
: tr::lng_action_gift_can_remove_text)
|
|
||||||
: (giftToChannel
|
: (giftToChannel
|
||||||
? tr::lng_action_gift_got_gift_channel
|
? tr::lng_gift_channel_got
|
||||||
: tr::lng_action_gift_got_gift_text))(
|
: tr::lng_gift_got_stars))(
|
||||||
Ui::Text::WithEntities))),
|
lt_count,
|
||||||
st::creditsBoxAbout)))->entity();
|
rpl::single(e.starsConverted * 1.),
|
||||||
|
Ui::Text::RichLangValue),
|
||||||
|
tr::lng_paid_about_link()
|
||||||
|
) | rpl::map([](
|
||||||
|
TextWithEntities text,
|
||||||
|
QString link) {
|
||||||
|
return text.append(' ').append(
|
||||||
|
Ui::Text::Link(link));
|
||||||
|
})
|
||||||
|
: (e.savedToProfile
|
||||||
|
? (giftToChannel
|
||||||
|
? tr::lng_action_gift_can_remove_channel
|
||||||
|
: tr::lng_action_gift_can_remove_text)
|
||||||
|
: (giftToChannel
|
||||||
|
? tr::lng_action_gift_got_gift_channel
|
||||||
|
: tr::lng_action_gift_got_gift_text))(
|
||||||
|
Ui::Text::WithEntities))),
|
||||||
|
st::creditsBoxAbout),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
about->setClickHandlerFilter([=](const auto &...) {
|
about->setClickHandlerFilter([=](const auto &...) {
|
||||||
Core::App().iv().openWithIvPreferred(
|
Core::App().iv().openWithIvPreferred(
|
||||||
session,
|
session,
|
||||||
@ -1690,8 +1693,7 @@ void GenericCreditsEntryBox(
|
|||||||
std::move(text),
|
std::move(text),
|
||||||
u"internal:stars_examples"_q);
|
u"internal:stars_examples"_q);
|
||||||
});
|
});
|
||||||
box->addRow(object_ptr<Ui::CenterWrap<>>(
|
box->addRow(
|
||||||
box,
|
|
||||||
Ui::CreateLabelWithCustomEmoji(
|
Ui::CreateLabelWithCustomEmoji(
|
||||||
box,
|
box,
|
||||||
(!e.in && peer)
|
(!e.in && peer)
|
||||||
@ -1706,7 +1708,9 @@ void GenericCreditsEntryBox(
|
|||||||
std::move(link),
|
std::move(link),
|
||||||
Ui::Text::RichLangValue),
|
Ui::Text::RichLangValue),
|
||||||
Core::TextContext({ .session = session }),
|
Core::TextContext({ .session = session }),
|
||||||
st::creditsBoxAbout)));
|
st::creditsBoxAbout),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
} else if (e.paidMessagesCommission && e.barePeerId) {
|
} else if (e.paidMessagesCommission && e.barePeerId) {
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
auto link = tr::lng_credits_paid_messages_fee_about_link(
|
auto link = tr::lng_credits_paid_messages_fee_about_link(
|
||||||
@ -1719,8 +1723,7 @@ void GenericCreditsEntryBox(
|
|||||||
u"internal:edit_paid_messages_fee/"_q + QString::number(id));
|
u"internal:edit_paid_messages_fee/"_q + QString::number(id));
|
||||||
});
|
});
|
||||||
const auto percent = 100. - (e.paidMessagesCommission / 10.);
|
const auto percent = 100. - (e.paidMessagesCommission / 10.);
|
||||||
box->addRow(object_ptr<Ui::CenterWrap<>>(
|
box->addRow(
|
||||||
box,
|
|
||||||
Ui::CreateLabelWithCustomEmoji(
|
Ui::CreateLabelWithCustomEmoji(
|
||||||
box,
|
box,
|
||||||
tr::lng_credits_paid_messages_fee_about(
|
tr::lng_credits_paid_messages_fee_about(
|
||||||
@ -1731,7 +1734,9 @@ void GenericCreditsEntryBox(
|
|||||||
std::move(link),
|
std::move(link),
|
||||||
Ui::Text::RichLangValue),
|
Ui::Text::RichLangValue),
|
||||||
Core::TextContext({ .session = session }),
|
Core::TextContext({ .session = session }),
|
||||||
st::creditsBoxAbout)));
|
st::creditsBoxAbout),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
@ -1864,8 +1869,7 @@ void GenericCreditsEntryBox(
|
|||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
|
|
||||||
if (!isStarGift && e.credits.stars()) {
|
if (!isStarGift && e.credits.stars()) {
|
||||||
box->addRow(object_ptr<Ui::CenterWrap<>>(
|
box->addRow(
|
||||||
box,
|
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
tr::lng_credits_box_out_about(
|
tr::lng_credits_box_out_about(
|
||||||
@ -1874,7 +1878,9 @@ void GenericCreditsEntryBox(
|
|||||||
) | Ui::Text::ToLink(
|
) | Ui::Text::ToLink(
|
||||||
tr::lng_credits_box_out_about_link(tr::now)),
|
tr::lng_credits_box_out_about_link(tr::now)),
|
||||||
Ui::Text::WithEntities),
|
Ui::Text::WithEntities),
|
||||||
st::creditsBoxAboutDivider)));
|
st::creditsBoxAboutDivider),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
} else if (starGiftCanManage) {
|
} else if (starGiftCanManage) {
|
||||||
const auto hiddenPhrase = giftToChannelCanManage
|
const auto hiddenPhrase = giftToChannelCanManage
|
||||||
? tr::lng_gift_hidden_hint_channel
|
? tr::lng_gift_hidden_hint_channel
|
||||||
@ -1925,7 +1931,9 @@ void GenericCreditsEntryBox(
|
|||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
std::move(text),
|
std::move(text),
|
||||||
st::creditsBoxAboutDivider));
|
st::creditsBoxAboutDivider),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
label->setClickHandlerFilter([=](const auto &...) {
|
label->setClickHandlerFilter([=](const auto &...) {
|
||||||
toggleVisibility(!e.savedToProfile);
|
toggleVisibility(!e.savedToProfile);
|
||||||
return false;
|
return false;
|
||||||
@ -1942,7 +1950,9 @@ void GenericCreditsEntryBox(
|
|||||||
Ui::Text::WithEntities
|
Ui::Text::WithEntities
|
||||||
) | Ui::Text::ToLink(),
|
) | Ui::Text::ToLink(),
|
||||||
Ui::Text::WithEntities),
|
Ui::Text::WithEntities),
|
||||||
st::creditsBoxAboutDivider));
|
st::creditsBoxAboutDivider),
|
||||||
|
st::boxRowPadding,
|
||||||
|
style::al_top);
|
||||||
label->setClickHandlerFilter([=](const auto &...) {
|
label->setClickHandlerFilter([=](const auto &...) {
|
||||||
UrlClickHandler::Open(
|
UrlClickHandler::Open(
|
||||||
TonAddressUrl(session, uniqueGift->ownerAddress));
|
TonAddressUrl(session, uniqueGift->ownerAddress));
|
||||||
@ -1994,8 +2004,7 @@ void GenericCreditsEntryBox(
|
|||||||
} else if (s.cancelled || s.cancelledByBot) {
|
} else if (s.cancelled || s.cancelledByBot) {
|
||||||
label->setTextColorOverride(st::menuIconAttentionColor->c);
|
label->setTextColorOverride(st::menuIconAttentionColor->c);
|
||||||
}
|
}
|
||||||
box->addRow(
|
box->addRow(std::move(label), st::boxRowPadding, style::al_top);
|
||||||
object_ptr<Ui::CenterWrap<>>(box, std::move(label)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
|
@ -862,13 +862,12 @@ void SetupTopContent(
|
|||||||
verticalLayout->add(std::move(icon.widget));
|
verticalLayout->add(std::move(icon.widget));
|
||||||
|
|
||||||
verticalLayout->add(
|
verticalLayout->add(
|
||||||
object_ptr<Ui::CenterWrap<>>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
verticalLayout,
|
verticalLayout,
|
||||||
object_ptr<Ui::FlatLabel>(
|
tr::lng_filters_about(),
|
||||||
verticalLayout,
|
st::settingsFilterDividerLabel),
|
||||||
tr::lng_filters_about(),
|
st::settingsFilterDividerLabelPadding,
|
||||||
st::settingsFilterDividerLabel)),
|
style::al_top)->setTryMakeSimilarLines(true);
|
||||||
st::settingsFilterDividerLabelPadding);
|
|
||||||
|
|
||||||
verticalLayout->geometryValue(
|
verticalLayout->geometryValue(
|
||||||
) | rpl::start_with_next([=](const QRect &r) {
|
) | rpl::start_with_next([=](const QRect &r) {
|
||||||
|
@ -752,14 +752,16 @@ void AskBoostBox(
|
|||||||
box,
|
box,
|
||||||
std::move(title),
|
std::move(title),
|
||||||
st::boostCenteredTitle),
|
st::boostCenteredTitle),
|
||||||
st::boxRowPadding + QMargins(0, st::boostTitleSkip, 0, 0));
|
st::boxRowPadding + QMargins(0, st::boostTitleSkip, 0, 0),
|
||||||
|
style::al_top);
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
std::move(text),
|
std::move(text),
|
||||||
st::boostText),
|
st::boostText),
|
||||||
(st::boxRowPadding
|
(st::boxRowPadding
|
||||||
+ QMargins(0, st::boostTextSkip, 0, st::boostBottomSkip)));
|
+ QMargins(0, st::boostTextSkip, 0, st::boostBottomSkip)),
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
auto stats = object_ptr<Ui::IconButton>(box, st::boostLinkStatsButton);
|
auto stats = object_ptr<Ui::IconButton>(box, st::boostLinkStatsButton);
|
||||||
stats->setClickedCallback(openStatistics);
|
stats->setClickedCallback(openStatistics);
|
||||||
|
@ -201,7 +201,8 @@ void CollectibleInfoBox(
|
|||||||
box,
|
box,
|
||||||
rpl::single(header),
|
rpl::single(header),
|
||||||
st::collectibleHeader),
|
st::collectibleHeader),
|
||||||
st::collectibleHeaderPadding
|
st::collectibleHeaderPadding,
|
||||||
|
style::al_top
|
||||||
)->setClickHandlerFilter([copyCallback](const auto &...) {
|
)->setClickHandlerFilter([copyCallback](const auto &...) {
|
||||||
copyCallback(false);
|
copyCallback(false);
|
||||||
return false;
|
return false;
|
||||||
@ -220,7 +221,8 @@ void CollectibleInfoBox(
|
|||||||
Ui::Text::RichLangValue);
|
Ui::Text::RichLangValue);
|
||||||
const auto label = box->addRow(
|
const auto label = box->addRow(
|
||||||
object_ptr<Ui::FlatLabel>(box, st::collectibleInfo),
|
object_ptr<Ui::FlatLabel>(box, st::collectibleInfo),
|
||||||
st::collectibleInfoPadding);
|
st::collectibleInfoPadding,
|
||||||
|
style::al_top);
|
||||||
label->setAttribute(Qt::WA_TransparentForMouseEvents);
|
label->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||||
label->setMarkedText(text);
|
label->setMarkedText(text);
|
||||||
|
|
||||||
|
@ -57,10 +57,12 @@ constexpr auto kShowOrLineOpacity = 0.3;
|
|||||||
object_ptr<RpWidget> MakeShowOrLabel(
|
object_ptr<RpWidget> MakeShowOrLabel(
|
||||||
not_null<RpWidget*> parent,
|
not_null<RpWidget*> parent,
|
||||||
rpl::producer<QString> text) {
|
rpl::producer<QString> text) {
|
||||||
auto result = object_ptr<FlatLabel>(
|
auto result = object_ptr<CenterWrap<>>(
|
||||||
parent,
|
parent,
|
||||||
std::move(text),
|
object_ptr<FlatLabel>(
|
||||||
st::showOrLabel);
|
parent,
|
||||||
|
std::move(text),
|
||||||
|
st::showOrLabel));
|
||||||
const auto raw = result.data();
|
const auto raw = result.data();
|
||||||
|
|
||||||
raw->paintRequest(
|
raw->paintRequest(
|
||||||
@ -69,7 +71,8 @@ object_ptr<RpWidget> MakeShowOrLabel(
|
|||||||
|
|
||||||
const auto full = st::showOrLineWidth;
|
const auto full = st::showOrLineWidth;
|
||||||
const auto left = (raw->width() - full) / 2;
|
const auto left = (raw->width() - full) / 2;
|
||||||
const auto text = raw->textMaxWidth() + 2 * st::showOrLabelSkip;
|
const auto text = raw->entity()->naturalWidth()
|
||||||
|
+ 2 * st::showOrLabelSkip;
|
||||||
const auto fill = (full - text) / 2;
|
const auto fill = (full - text) / 2;
|
||||||
const auto stroke = st::lineWidth;
|
const auto stroke = st::lineWidth;
|
||||||
const auto top = st::showOrLineTop;
|
const auto top = st::showOrLineTop;
|
||||||
@ -152,13 +155,15 @@ void ShowOrPremiumBox(
|
|||||||
box,
|
box,
|
||||||
std::move(skin.showTitle),
|
std::move(skin.showTitle),
|
||||||
st::boostCenteredTitle),
|
st::boostCenteredTitle),
|
||||||
st::showOrTitlePadding + buttonPadding);
|
st::showOrTitlePadding + buttonPadding,
|
||||||
|
style::al_top);
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<FlatLabel>(
|
object_ptr<FlatLabel>(
|
||||||
box,
|
box,
|
||||||
std::move(skin.showAbout),
|
std::move(skin.showAbout),
|
||||||
st::boostText),
|
st::boostText),
|
||||||
st::showOrAboutPadding + buttonPadding);
|
st::showOrAboutPadding + buttonPadding,
|
||||||
|
style::al_top);
|
||||||
const auto show = box->addRow(
|
const auto show = box->addRow(
|
||||||
object_ptr<RoundButton>(
|
object_ptr<RoundButton>(
|
||||||
box,
|
box,
|
||||||
@ -168,19 +173,22 @@ void ShowOrPremiumBox(
|
|||||||
show->setTextTransform(RoundButton::TextTransform::NoTransform);
|
show->setTextTransform(RoundButton::TextTransform::NoTransform);
|
||||||
box->addRow(
|
box->addRow(
|
||||||
MakeShowOrLabel(box, std::move(skin.orPremium)),
|
MakeShowOrLabel(box, std::move(skin.orPremium)),
|
||||||
st::showOrLabelPadding + buttonPadding);
|
st::showOrLabelPadding + buttonPadding,
|
||||||
|
style::al_top);
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<FlatLabel>(
|
object_ptr<FlatLabel>(
|
||||||
box,
|
box,
|
||||||
std::move(skin.premiumTitle),
|
std::move(skin.premiumTitle),
|
||||||
st::boostCenteredTitle),
|
st::boostCenteredTitle),
|
||||||
st::showOrTitlePadding + buttonPadding);
|
st::showOrTitlePadding + buttonPadding,
|
||||||
|
style::al_top);
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<FlatLabel>(
|
object_ptr<FlatLabel>(
|
||||||
box,
|
box,
|
||||||
std::move(skin.premiumAbout),
|
std::move(skin.premiumAbout),
|
||||||
st::boostText),
|
st::boostText),
|
||||||
st::showOrPremiumAboutPadding + buttonPadding);
|
st::showOrPremiumAboutPadding + buttonPadding,
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
const auto premium = CreateChild<GradientButton>(
|
const auto premium = CreateChild<GradientButton>(
|
||||||
box.get(),
|
box.get(),
|
||||||
|
@ -288,19 +288,21 @@ void AboutRatingBox(
|
|||||||
lt_name,
|
lt_name,
|
||||||
rpl::single(TextWithEntities{ name }),
|
rpl::single(TextWithEntities{ name }),
|
||||||
Ui::Text::RichLangValue);
|
Ui::Text::RichLangValue);
|
||||||
const auto aboutNegative = box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
std::move(text),
|
std::move(text),
|
||||||
st::boostTextNegative),
|
st::boostTextNegative),
|
||||||
(st::boxRowPadding
|
(st::boxRowPadding
|
||||||
+ QMargins(0, st::boostTextSkip, 0, st::boostBottomSkip)));
|
+ QMargins(0, st::boostTextSkip, 0, st::boostBottomSkip)),
|
||||||
aboutNegative->setTryMakeSimilarLines(true);
|
style::al_top
|
||||||
|
)->setTryMakeSimilarLines(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::FlatLabel>(box, std::move(title), st::infoStarsTitle),
|
object_ptr<Ui::FlatLabel>(box, std::move(title), st::infoStarsTitle),
|
||||||
st::boxRowPadding + QMargins(0, st::boostTitleSkip / 2, 0, 0));
|
st::boxRowPadding + QMargins(0, st::boostTitleSkip / 2, 0, 0),
|
||||||
|
style::al_top);
|
||||||
|
|
||||||
if (pending) {
|
if (pending) {
|
||||||
const auto now = base::unixtime::now();
|
const auto now = base::unixtime::now();
|
||||||
@ -331,7 +333,8 @@ void AboutRatingBox(
|
|||||||
std::move(text),
|
std::move(text),
|
||||||
st::boostTextPending),
|
st::boostTextPending),
|
||||||
(st::boxRowPadding
|
(st::boxRowPadding
|
||||||
+ QMargins(0, st::boostTextSkip, 0, st::boostBottomSkip)));
|
+ QMargins(0, st::boostTextSkip, 0, st::boostBottomSkip)),
|
||||||
|
style::al_top);
|
||||||
aboutPending->setTryMakeSimilarLines(true);
|
aboutPending->setTryMakeSimilarLines(true);
|
||||||
aboutPending->setClickHandlerFilter([=](const auto &...) {
|
aboutPending->setClickHandlerFilter([=](const auto &...) {
|
||||||
state->pending = !state->pending.current();
|
state->pending = !state->pending.current();
|
||||||
@ -343,14 +346,15 @@ void AboutRatingBox(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto aboutLabel = box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
std::move(text),
|
std::move(text),
|
||||||
st::boostText),
|
st::boostText),
|
||||||
(st::boxRowPadding
|
(st::boxRowPadding
|
||||||
+ QMargins(0, st::boostTextSkip, 0, st::boostBottomSkip)));
|
+ QMargins(0, st::boostTextSkip, 0, st::boostBottomSkip)),
|
||||||
aboutLabel->setTryMakeSimilarLines(true);
|
style::al_top
|
||||||
|
)->setTryMakeSimilarLines(true);
|
||||||
|
|
||||||
auto helper = Ui::Text::CustomEmojiHelper();
|
auto helper = Ui::Text::CustomEmojiHelper();
|
||||||
const auto makeBadge = [&](
|
const auto makeBadge = [&](
|
||||||
|
@ -224,18 +224,6 @@ premiumGiftOption: PremiumOption {
|
|||||||
badgeMargins: margins(5px, 1px, 5px, 0px);
|
badgeMargins: margins(5px, 1px, 5px, 0px);
|
||||||
}
|
}
|
||||||
|
|
||||||
premiumGiftUserpicPadding: margins(10px, 27px, 18px, 13px);
|
|
||||||
premiumGiftTitlePadding: margins(18px, 0px, 18px, 0px);
|
|
||||||
premiumGiftAboutPadding: margins(18px, 5px, 18px, 23px);
|
|
||||||
premiumGiftTermsPadding: margins(18px, 27px, 18px, 0px);
|
|
||||||
premiumGiftTerms: FlatLabel(defaultFlatLabel) {
|
|
||||||
minWidth: 256px;
|
|
||||||
align: align(top);
|
|
||||||
textFg: windowSubTextFg;
|
|
||||||
style: TextStyle(defaultTextStyle) {
|
|
||||||
font: font(11px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
premiumGiftBox: Box(premiumPreviewBox) {
|
premiumGiftBox: Box(premiumPreviewBox) {
|
||||||
buttonPadding: margins(12px, 12px, 12px, 12px);
|
buttonPadding: margins(12px, 12px, 12px, 12px);
|
||||||
}
|
}
|
||||||
@ -245,10 +233,6 @@ premiumGiftsUserpicButton: UserpicButton(defaultUserpicButton) {
|
|||||||
photoSize: 66px;
|
photoSize: 66px;
|
||||||
photoPosition: point(-1px, -1px);
|
photoPosition: point(-1px, -1px);
|
||||||
}
|
}
|
||||||
premiumGiftsUserpicBadgeSize: size(26px, 26px);
|
|
||||||
premiumGiftsUserpicBadgeInner: 2px;
|
|
||||||
premiumGiftsUserpicBadgeFont: font(14px bold);
|
|
||||||
premiumGiftsBoostIcon: icon{{ "stories/boost_mini", windowBgActive }};
|
|
||||||
|
|
||||||
boostSkipTop: 37px;
|
boostSkipTop: 37px;
|
||||||
boostLimits: PremiumLimits(defaultPremiumLimits) {
|
boostLimits: PremiumLimits(defaultPremiumLimits) {
|
||||||
|
@ -14,15 +14,7 @@ namespace Ui {
|
|||||||
class CustomWidthSlider final : public SettingsSlider {
|
class CustomWidthSlider final : public SettingsSlider {
|
||||||
public:
|
public:
|
||||||
using Ui::SettingsSlider::SettingsSlider;
|
using Ui::SettingsSlider::SettingsSlider;
|
||||||
void setNaturalWidth(int w) {
|
using SettingsSlider::setNaturalWidth;
|
||||||
_naturalWidth = w;
|
|
||||||
}
|
|
||||||
int naturalWidth() const override {
|
|
||||||
return _naturalWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
int _naturalWidth = 0;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 7a21118ca0964dc66673df7a2241f846ec094860
|
Subproject commit 3201934f69e03d1461d8b5670ff6babbd6ca3789
|
Loading…
x
Reference in New Issue
Block a user