Added text transform to RoundButton as mandatory argument.

This commit is contained in:
23rd
2026-04-06 16:07:28 +03:00
parent d164a49675
commit 7c26a251cf
78 changed files with 267 additions and 253 deletions
+2 -3
View File
@@ -302,9 +302,8 @@ void ArchiveHintBox(
auto button = object_ptr<Ui::RoundButton>(
box,
tr::lng_archive_hint_button(),
st::defaultActiveButton);
button->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
st::defaultActiveButton,
Ui::RoundButtonTextNoTransform);
button->resizeToWidth(box->width()
- st.buttonPadding.left()
- st.buttonPadding.left());
@@ -35,10 +35,10 @@ void AboutSponsoredBox(not_null<Ui::GenericBox*> box) {
const auto button = Ui::CreateChild<RoundButton>(
row,
rpl::single<QString>(kUrl.utf8()),
st);
st,
RoundButtonTextNoTransform);
button->setBrushOverride(Qt::NoBrush);
button->setPenOverride(QPen(st::historyLinkInFg));
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
rpl::combine(
row->sizeValue(),
button->sizeValue()
@@ -758,7 +758,8 @@ void BackgroundPreviewBox::applyForPeer() {
const auto forMe = CreateChild<RoundButton>(
overlay,
tr::lng_background_apply_me(),
st::backgroundConfirm);
st::backgroundConfirm,
RoundButtonTextNoTransform);
forMe->setClickedCallback([=] {
applyForPeer(false);
});
@@ -769,6 +770,7 @@ void BackgroundPreviewBox::applyForPeer() {
lt_user,
rpl::single(_forPeer->shortName())),
st::backgroundConfirm,
RoundButtonTextNoTransform,
Data::AmPremiumValue(&_forPeer->session()) | rpl::map(!_1));
forBoth->setClickedCallback([=] {
if (_forPeer->session().premium()) {
@@ -782,7 +784,8 @@ void BackgroundPreviewBox::applyForPeer() {
const auto cancel = CreateChild<RoundButton>(
overlay,
tr::lng_cancel(),
st::backgroundConfirmCancel);
st::backgroundConfirmCancel,
RoundButtonTextNoTransform);
cancel->setClickedCallback([=] {
const auto raw = _forBothOverlay.release();
raw->shownValue() | rpl::filter(
@@ -792,10 +795,6 @@ void BackgroundPreviewBox::applyForPeer() {
}), raw->lifetime());
raw->toggle(false, anim::type::normal);
});
forMe->setTextTransform(RoundButton::TextTransform::NoTransform);
forBoth->setTextTransform(RoundButton::TextTransform::NoTransform);
cancel->setTextTransform(RoundButton::TextTransform::NoTransform);
overlay->sizeValue(
) | rpl::on_next([=](QSize size) {
const auto padding = st::backgroundConfirmPadding;
@@ -168,8 +168,7 @@ LocalStorageBox::Row::Row(
this,
sizeText(data),
st::localStorageRowSize)
, _clear(this, std::move(clear), st::localStorageClear) {
_clear->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
, _clear(this, std::move(clear), st::localStorageClear, Ui::RoundButtonTextNoTransform) {
_clear->setVisible(data.count != 0);
}
@@ -1546,7 +1546,6 @@ not_null<Info::Profile::TopBar*> CreateProfilePreview(
}
void ProcessButton(not_null<Ui::RoundButton*> button) {
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
// Raise to be above right emoji from buttons.
crl::on_main(button, [=] { button->raise(); });
}
@@ -2425,11 +2424,13 @@ void EditPeerColorBox(
const auto profileButton = Ui::CreateChild<Ui::RoundButton>(
buttonContainer,
tr::lng_settings_color_apply(),
box->getDelegate()->style().button);
box->getDelegate()->style().button,
Ui::RoundButtonTextToUpper);
const auto nameButton = Ui::CreateChild<Ui::RoundButton>(
buttonContainer,
tr::lng_settings_color_apply(),
box->getDelegate()->style().button);
box->getDelegate()->style().button,
Ui::RoundButtonTextToUpper);
rpl::combine(
buttonContainer->widthValue(),
profileButton->sizeValue(),
@@ -321,7 +321,8 @@ void SelectFutureOwnerbox(
!adminsAreEqual
? tr::lng_select_next_owner_box()
: tr::lng_select_next_owner_box_admin(),
st::defaultLightButton),
st::defaultLightButton,
Ui::RoundButtonTextNoTransform),
st::boxRowPadding,
style::al_justify);
Ui::AddSkip(content);
@@ -329,7 +330,8 @@ void SelectFutureOwnerbox(
object_ptr<Ui::RoundButton>(
content,
tr::lng_cancel(),
st::defaultLightButton),
st::defaultLightButton,
Ui::RoundButtonTextNoTransform),
st::boxRowPadding,
style::al_justify);
cancel->setClickedCallback([=] {
@@ -342,7 +344,8 @@ void SelectFutureOwnerbox(
isGroup
? tr::lng_profile_leave_group()
: tr::lng_profile_leave_channel(),
st::attentionBoxButton),
st::attentionBoxButton,
Ui::RoundButtonTextNoTransform),
st::boxRowPadding,
style::al_justify);
leave->setClickedCallback([=, revoke = false] {
@@ -476,9 +479,8 @@ void SelectFutureOwnerbox(
}),
tr::lng_select_next_owner_box_confirm(),
tr::lng_close()),
st::defaultActiveButton);
button->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
st::defaultActiveButton,
Ui::RoundButtonTextNoTransform);
const auto raw = button.data();
rpl::combine(
state->selectionChanges.events() | rpl::map_to(0),
@@ -523,7 +525,6 @@ void SelectFutureOwnerbox(
});
for (const auto &b : { select, cancel, leave }) {
b->setFullRadius(true);
b->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
}
box->setStyle(st::futureOwnerBox);
}
@@ -1983,9 +1983,9 @@ object_ptr<Ui::RpWidget> MakeActiveAuctionRow(
object_ptr<Ui::RoundButton>(
raw,
rpl::single(QString()),
st::auctionListRaise),
st::auctionListRaise,
RoundButtonTextNoTransform),
st::auctionListRaisePadding);
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
auto secondsLeft = rpl::duplicate(
value
@@ -1556,10 +1556,13 @@ void StarGiftPreviewBox(
const style::RoundButton &st,
const style::icon &active,
Tab tab) {
auto owned = object_ptr<RoundButton>(buttonsParent, text(), st);
auto owned = object_ptr<RoundButton>(
buttonsParent,
text(),
st,
RoundButtonTextNoTransform);
const auto raw = owned.data();
raw->setTextTransform(RoundButton::TextTransform::NoTransform);
raw->setClickedCallback([=] {
state->tab = tab;
});
@@ -35,7 +35,6 @@ void PrepareFullWidthRoundButton(
not_null<Ui::RoundButton*> button,
not_null<Ui::VerticalLayout*> content,
const style::margins &padding) {
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
button->setFullRadius(true);
const auto paddingHorizontal = padding.left() + padding.right();
content->widthValue() | rpl::on_next([=](int w) {
@@ -83,7 +82,8 @@ void ShowMatchCodesBox(
const auto button = Ui::CreateChild<Ui::RoundButton>(
buttons,
rpl::single(emojiCode ? QString() : code),
st::urlAuthCodesButton);
st::urlAuthCodesButton,
Ui::RoundButtonTextNoTransform);
if (emojiCode) {
button->setTextFgOverride(QColor(Qt::transparent));
const auto overlay = Ui::CreateChild<Ui::RpWidget>(button);
@@ -165,7 +165,6 @@ void ShowMatchCodesBox(
(overlay->height() - visible) / 2);
});
}
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
button->setFullRadius(true);
button->setClickedCallback([=] {
callback(code);
@@ -201,7 +200,8 @@ void ShowMatchCodesBox(
object_ptr<Ui::RoundButton>(
content,
tr::lng_cancel(),
st::attentionBoxButton),
st::attentionBoxButton,
Ui::RoundButtonTextNoTransform),
padding);
PrepareFullWidthRoundButton(button, content, padding);
button->setClickedCallback([=] {
@@ -550,7 +550,8 @@ void ShowDetails(
object_ptr<Ui::RoundButton>(
content,
tr::lng_url_auth_login_button(),
st::defaultLightButton),
st::defaultLightButton,
Ui::RoundButtonTextNoTransform),
padding);
PrepareFullWidthRoundButton(button, content, padding);
button->setClickedCallback([=] {
@@ -587,7 +588,8 @@ void ShowDetails(
object_ptr<Ui::RoundButton>(
content,
tr::lng_suggest_action_decline(),
st::attentionBoxButton),
st::attentionBoxButton,
Ui::RoundButtonTextNoTransform),
padding);
PrepareFullWidthRoundButton(button, content, padding);
button->setClickedCallback([=] {
@@ -257,8 +257,8 @@ void StartRtmpProcess::FillRtmpRows(
auto button = Ui::CreateChild<Ui::RoundButton>(
wrap.data(),
rpl::duplicate(text),
st::groupCallRtmpCopyButton);
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::groupCallRtmpCopyButton,
Ui::RoundButtonTextNoTransform);
button->setClickedCallback(key
? Fn<void()>([=] {
QGuiApplication::clipboard()->setText(state->key.current());
@@ -260,12 +260,14 @@ ChooseSourceProcess::ChooseSourceProcess(
CreateChild<RoundButton>(
_bottom.get(),
tr::lng_group_call_screen_share_start(),
st::desktopCaptureSubmit))
st::desktopCaptureSubmit,
RoundButtonTextToUpper))
, _finish(
CreateChild<RoundButton>(
_bottom.get(),
tr::lng_group_call_screen_share_stop(),
st::desktopCaptureFinish))
st::desktopCaptureFinish,
RoundButtonTextToUpper))
, _withAudio(
CreateChild<Checkbox>(
_bottom.get(),
@@ -369,7 +371,8 @@ void ChooseSourceProcess::setupPanel() {
const auto cancel = CreateChild<RoundButton>(
_bottom.get(),
tr::lng_cancel(),
st::desktopCaptureCancel);
st::desktopCaptureCancel,
RoundButtonTextToUpper);
cancel->setClickedCallback([=] {
_window->close();
});
@@ -198,10 +198,10 @@ PreviewWrap::PreviewWrap(
item->out()
? tr::lng_close()
: tr::lng_ttl_voice_close_in(),
st::ttlMediaButton);
st::ttlMediaButton,
Ui::RoundButtonTextNoTransform);
close->setFullRadius(true);
close->setClickedCallback(closeCallback);
close->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
rpl::combine(
sizeValue(),
@@ -4333,9 +4333,8 @@ void InnerWidget::refreshEmpty() {
_emptyButton.create(
this,
tr::lng_no_conversations_button(),
st::dialogEmptyButton);
_emptyButton->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
st::dialogEmptyButton,
Ui::RoundButtonTextNoTransform);
_emptyButton->setVisible(isListVisible);
_emptyButton->setClickedCallback([=, window = _controller] {
window->show(PrepareContactsBox(window));
@@ -126,13 +126,13 @@ not_null<Ui::SlideWrap<Ui::VerticalLayout>*> CreateUnconfirmedAuthContent(
const auto yes = Ui::CreateChild<Ui::RoundButton>(
buttons,
tr::lng_unconfirmed_auth_confirm(),
st::dialogsUnconfirmedAuthButton);
st::dialogsUnconfirmedAuthButton,
Ui::RoundButtonTextNoTransform);
const auto no = Ui::CreateChild<Ui::RoundButton>(
buttons,
tr::lng_unconfirmed_auth_deny(),
st::dialogsUnconfirmedAuthButtonNo);
yes->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
no->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::dialogsUnconfirmedAuthButtonNo,
Ui::RoundButtonTextNoTransform);
yes->setClickedCallback([=] {
wrap->toggle(false, anim::type::normal);
base::call_delayed(st::universalDuration, wrap, [=] {
@@ -237,7 +237,8 @@ void ShowAuthDeniedBox(
object_ptr<Ui::RoundButton>(
box,
rpl::single(QString()),
st::defaultActiveButton));
st::defaultActiveButton,
Ui::RoundButtonTextNoTransform));
confirm->setClickedCallback([=] {
box->closeBox();
});
@@ -362,7 +363,8 @@ void TopBarSuggestionContent::setRightButton(
_rightButton = base::make_unique_q<RoundButton>(
this,
rpl::single(QString()),
st::dialogsTopBarRightButton);
st::dialogsTopBarRightButton,
RoundButtonTextNoTransform);
_rightButton->setText(std::move(text));
rpl::combine(
sizeValue(),
@@ -372,7 +374,6 @@ void TopBarSuggestionContent::setRightButton(
_rightButton->moveToRight(top, top, outer.width());
}, _rightButton->lifetime());
_rightButton->setFullRadius(true);
_rightButton->setTextTransform(RoundButton::TextTransform::NoTransform);
_rightButton->setClickedCallback(std::move(callback));
_rightButton->show();
}
@@ -185,9 +185,9 @@ void PostsSearchIntro::setup() {
object_ptr<Ui::RoundButton>(
_content.get(),
rpl::single(QString()),
st::postsSearchIntroButton),
st::postsSearchIntroButton,
Ui::RoundButtonTextNoTransform),
style::al_top);
_button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
_footer = _content->add(
object_ptr<Ui::FlatLabel>(
_content.get(),
@@ -277,7 +277,8 @@ ProgressWidget::ProgressWidget(
_cancel = base::make_unique_q<Ui::RoundButton>(
this,
tr::lng_export_stop(),
st::exportCancelButton);
st::exportCancelButton,
Ui::RoundButtonTextNoTransform);
setupBottomButton(_cancel.get());
}
@@ -297,7 +298,6 @@ rpl::producer<> ProgressWidget::doneClicks() const {
}
void ProgressWidget::setupBottomButton(not_null<Ui::RoundButton*> button) {
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
button->show();
sizeValue(
@@ -361,7 +361,8 @@ void ProgressWidget::showDone() {
_done = base::make_unique_q<Ui::RoundButton>(
this,
tr::lng_export_done(),
st::exportDoneButton);
st::exportDoneButton,
Ui::RoundButtonTextNoTransform);
const auto desired = std::min(
st::exportDoneButton.style.font->width(tr::lng_export_done(tr::now))
+ st::exportDoneButton.height
@@ -885,10 +885,10 @@ void SettingsWidget::refreshButtons(
? Ui::CreateChild<Ui::RoundButton>(
container.get(),
tr::lng_export_start(),
st::defaultBoxButton)
st::defaultBoxButton,
Ui::RoundButtonTextNoTransform)
: nullptr;
if (start) {
start->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
start->show();
_startClicks = start->clicks() | rpl::to_empty;
@@ -903,8 +903,8 @@ void SettingsWidget::refreshButtons(
const auto cancel = Ui::CreateChild<Ui::RoundButton>(
container.get(),
tr::lng_cancel(),
st::defaultBoxButton);
cancel->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::defaultBoxButton,
Ui::RoundButtonTextNoTransform);
cancel->show();
_cancelClicks = cancel->clicks() | rpl::to_empty;
@@ -5878,11 +5878,10 @@ bool HistoryWidget::updateCmdStartShown() {
(_botMenu.text.isEmpty()
? tr::lng_bot_menu_button()
: rpl::single(_botMenu.text)),
st::historyBotMenuButton);
st::historyBotMenuButton,
Ui::RoundButtonTextNoTransform);
orderWidgets();
_botMenu.button->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
_botMenu.button->setFullRadius(true);
_botMenu.button->setClickedCallback([=] {
const auto user = _peer ? _peer->asUser() : nullptr;
@@ -3074,10 +3074,10 @@ void SetupRestrictionView(
auto unlock = std::make_unique<RoundButton>(
widget,
rpl::single(text),
st->premiumRequired.button);
st->premiumRequired.button,
RoundButtonTextNoTransform);
unlock->show();
unlock->setAttribute(Qt::WA_TransparentForMouseEvents);
unlock->setTextTransform(RoundButton::TextTransform::NoTransform);
unlock->setFullRadius(true);
return unlock;
};
@@ -1014,13 +1014,12 @@ BusinessBotStatus::Bar::Bar(QWidget *parent)
, _togglePaused(
this,
rpl::single(QString()),
st::historyBusinessBotToggle)
st::historyBusinessBotToggle,
Ui::RoundButtonTextNoTransform)
, _settings(this, st::historyBusinessBotSettings) {
_name->setAttribute(Qt::WA_TransparentForMouseEvents);
_status->setAttribute(Qt::WA_TransparentForMouseEvents);
_togglePaused->setFullRadius(true);
_togglePaused->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
_settings->setClickedCallback([=] {
showMenu();
});
@@ -170,7 +170,8 @@ auto WithPinnedTitle(not_null<Main::Session*> session, PinnedId id) {
auto button = object_ptr<Ui::RoundButton>(
parent,
rpl::never<QString>(), // Text is handled by the inner label.
stButton);
stButton,
Ui::RoundButtonTextNoTransform);
const auto label = Ui::CreateChild<Ui::FlatLabel>(
button.data(),
@@ -192,7 +193,6 @@ auto WithPinnedTitle(not_null<Main::Session*> session, PinnedId id) {
label->setTextColorOverride(stButton.textFg->c); // Use button's text color for label.
label->setAttribute(Qt::WA_TransparentForMouseEvents);
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
button->setFullRadius(true);
button->setClickedCallback(std::move(clickCallback));
@@ -1741,8 +1741,8 @@ bool ShowScheduledVideoPublished(
const auto button = Ui::CreateChild<Ui::RoundButton>(
widget.get(),
rpl::single(view),
st::processingVideoView);
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::processingVideoView,
Ui::RoundButtonTextNoTransform);
button->show();
rpl::combine(
widget->sizeValue(),
@@ -201,8 +201,8 @@ void StickerToast::showWithTitle(const QString &title) {
const auto button = Ui::CreateChild<Ui::RoundButton>(
widget.get(),
rpl::single(view),
st::historyPremiumViewSet);
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::historyPremiumViewSet,
Ui::RoundButtonTextNoTransform);
button->show();
rpl::combine(
widget->sizeValue(),
@@ -117,10 +117,10 @@ TopBarWidget::TopBarWidget(
: RpWidget(parent)
, _controller(controller)
, _primaryWindow(controller->isPrimary())
, _clear(this, tr::lng_selected_clear(), st::topBarClearButton)
, _forward(this, tr::lng_selected_forward(), st::defaultActiveButton)
, _sendNow(this, tr::lng_selected_send_now(), st::defaultActiveButton)
, _delete(this, tr::lng_selected_delete(), st::defaultActiveButton)
, _clear(this, tr::lng_selected_clear(), st::topBarClearButton, Ui::RoundButtonTextToUpper)
, _forward(this, tr::lng_selected_forward(), st::defaultActiveButton, Ui::RoundButtonTextToUpper)
, _sendNow(this, tr::lng_selected_send_now(), st::defaultActiveButton, Ui::RoundButtonTextToUpper)
, _delete(this, tr::lng_selected_delete(), st::defaultActiveButton, Ui::RoundButtonTextToUpper)
, _back(this, st::historyTopBarBack)
, _cancelChoose(this, st::topBarCloseChoose)
, _call(this, st::topBarCall)
@@ -599,8 +599,8 @@ void TranslateBar::showToast(
const auto button = Ui::CreateChild<Ui::RoundButton>(
widget.get(),
rpl::single(buttonText),
st::historyPremiumViewSet);
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::historyPremiumViewSet,
Ui::RoundButtonTextNoTransform);
button->show();
rpl::combine(
widget->sizeValue(),
@@ -447,7 +447,8 @@ private:
auto result = object_ptr<Ui::RoundButton>(
parent,
rpl::single(QString()),
st::starrefBottomButton);
st::starrefBottomButton,
Ui::RoundButtonTextToUpper);
const auto raw = result.data();
rpl::combine(
parent->widthValue(),
@@ -1344,7 +1344,8 @@ void CreateGiveawayBox(
auto button = object_ptr<Ui::RoundButton>(
box,
rpl::never<QString>(),
st::giveawayGiftCodeStartButton);
st::giveawayGiftCodeStartButton,
Ui::RoundButtonTextNoTransform);
AddLabelWithBadgeToButton(
button,
@@ -1379,7 +1380,6 @@ void CreateGiveawayBox(
loadingAnimation->showOn(state->confirmButtonBusy.value());
}
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
state->typeValue.value(
) | rpl::on_next([=, raw = button.data()] {
raw->resizeToWidth(box->width()
@@ -202,14 +202,14 @@ void FillShareLink(
const auto copy = CreateChild<Ui::RoundButton>(
wrap,
tr::lng_group_invite_context_copy(),
st::inviteLinkCopy);
copy->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::inviteLinkCopy,
Ui::RoundButtonTextNoTransform);
copy->setClickedCallback(copyLink);
const auto share = CreateChild<Ui::RoundButton>(
wrap,
tr::lng_group_invite_context_share(),
st::inviteLinkShare);
share->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::inviteLinkShare,
Ui::RoundButtonTextNoTransform);
share->setClickedCallback(shareLink);
wrap->widthValue(
@@ -144,7 +144,8 @@ void AddRecipient(not_null<Ui::GenericBox*> box, const TextWithEntities &t) {
object_ptr<Ui::RoundButton>(
box,
rpl::single(QString()),
st::channelEarnHistoryRecipientButton),
st::channelEarnHistoryRecipientButton,
Ui::RoundButtonTextToUpper),
style::al_top);
const auto label = Ui::CreateChild<Ui::FlatLabel>(
container,
@@ -593,9 +594,8 @@ void InnerWidget::fill() {
auto button = object_ptr<Ui::RoundButton>(
container,
tr::lng_channel_earn_learn_close(),
st::defaultActiveButton);
button->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
st::defaultActiveButton,
Ui::RoundButtonTextNoTransform);
button->resizeToWidth(box->width()
- st.buttonPadding.left()
- st.buttonPadding.left());
@@ -884,7 +884,8 @@ void InnerWidget::fill() {
object_ptr<Ui::RoundButton>(
container,
rpl::never<QString>(),
stButton),
stButton,
Ui::RoundButtonTextToUpper),
st::boxRowPadding,
style::al_justify);
@@ -1236,7 +1237,8 @@ void InnerWidget::fill() {
(!entry.successLink.isEmpty())
? tr::lng_channel_earn_history_out_button()
: tr::lng_box_ok(),
st::defaultActiveButton);
st::defaultActiveButton,
Ui::RoundButtonTextToUpper);
button->resizeToWidth(box->width()
- st.buttonPadding.left()
- st.buttonPadding.left());
@@ -1305,15 +1305,14 @@ void InnerWidget::refreshAbout() {
object_ptr<Ui::RoundButton>(
about.get(),
rpl::single(QString()),
st::collectionEmptyButton),
st::collectionEmptyButton,
Ui::RoundButtonTextNoTransform),
st::collectionEmptyAddMargin,
style::al_top);
button->setText(tr::lng_gift_collection_add_button(
) | rpl::map([](const QString &text) {
return Ui::Text::IconEmoji(&st::collectionAddIcon).append(text);
}));
button->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
button->setClickedCallback([=] {
editCollectionGifts(collectionId);
});
@@ -2496,8 +2495,8 @@ void Widget::setupBottomButton(int wasBottomHeight) {
const auto button = Ui::CreateChild<Ui::RoundButton>(
bottom,
rpl::single(QString()),
st::collectionEditBox.button);
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::collectionEditBox.button,
Ui::RoundButtonTextNoTransform);
button->setText(tr::lng_gift_collection_add_button(
) | rpl::map([](const QString &text) {
return Ui::Text::IconEmoji(&st::collectionAddIcon).append(text);
@@ -269,9 +269,8 @@ void ListWidget::Inner::setupHistory() {
_newPollButton.create(
_scroll.get(),
tr::lng_polls_create_title(),
st::defaultActiveButton);
_newPollButton->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
st::defaultActiveButton,
Ui::RoundButtonTextNoTransform);
_newPollButton->setFullRadius(true);
_newPollButton->setClickedCallback([=] {
Window::PeerMenuCreatePoll(
@@ -394,7 +394,8 @@ base::options::toggle ShowChannelJoinedBelowAbout({
object_ptr<Ui::RoundButton>(
parent,
rpl::single(QString()),
st::infoHoursOuter),
st::infoHoursOuter,
Ui::RoundButtonTextToUpper),
st::infoProfileLabeledPadding - st::infoHoursOuterMargin);
const auto button = result->entity();
const auto inner = Ui::CreateChild<Ui::VerticalLayout>(button);
@@ -632,8 +633,8 @@ base::options::toggle ShowChannelJoinedBelowAbout({
const auto link = Ui::CreateChild<Ui::RoundButton>(
labelWrap,
std::move(linkText),
st::defaultTableSmallButton);
link->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::defaultTableSmallButton,
Ui::RoundButtonTextNoTransform);
link->setClickedCallback([=] {
state->myTimezone = !state->myTimezone.current();
state->expanded = true;
@@ -882,7 +883,8 @@ void DeleteContactNote(
object_ptr<Ui::RoundButton>(
parent,
rpl::single(QString()),
st::infoHoursOuter),
st::infoHoursOuter,
Ui::RoundButtonTextToUpper),
st::infoProfileLabeledPadding - st::infoHoursOuterMargin);
result->setDuration(st::infoSlideDuration);
const auto button = result->entity();
@@ -2131,10 +2133,10 @@ void DetailsFiller::setupMainApp(bool suppressBottom) {
object_ptr<Ui::RoundButton>(
_wrap,
tr::lng_profile_open_app(),
st::infoOpenApp),
st::infoOpenApp,
Ui::RoundButtonTextNoTransform),
st::infoOpenAppMargin,
style::al_justify);
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
const auto user = _peer->asUser();
const auto controller = _controller->parentController();
@@ -328,7 +328,8 @@ TopBar::TopBar(
object_ptr<Ui::RoundButton>(
this,
tr::lng_status_lastseen_when(),
st::infoProfileTopBarShowLastSeen))
st::infoProfileTopBarShowLastSeen,
Ui::RoundButtonTextNoTransform))
, _forumButton([&, controller = descriptor.controller] {
const auto topic = _key.topic();
if (!topic) {
@@ -337,7 +338,8 @@ TopBar::TopBar(
auto owned = object_ptr<Ui::RoundButton>(
this,
rpl::single(QString()),
st::infoProfileTopBarTopicStatusButton);
st::infoProfileTopBarTopicStatusButton,
Ui::RoundButtonTextNoTransform);
owned->setText(Info::Profile::NameValue(
_peer
) | rpl::map([=](const QString &name) {
@@ -345,7 +347,6 @@ TopBar::TopBar(
.append(' ')
.append(Ui::Text::IconEmoji(&st::textMoreIconEmoji, QString()));
}));
owned->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
owned->setClickedCallback([=, peer = _peer] {
if (const auto forum = peer->forum()) {
if (peer->useSubsectionTabs()) {
@@ -2133,8 +2134,6 @@ void TopBar::setupShowLastSeen(
_showLastSeen->setOpacity(0.);
using TextTransform = Ui::RoundButton::TextTransform;
_showLastSeen->entity()->setTextTransform(TextTransform::NoTransform);
_showLastSeen->entity()->setFullRadius(true);
_showLastSeen->entity()->setClickedCallback([=] {
@@ -156,6 +156,7 @@ void ListController::setupUnlock() {
? tr::lng_similar_channels_show_more()
: tr::lng_similar_bots_show_more()),
st::similarChannelsLock,
Ui::RoundButtonTextToUpper,
rpl::single(true));
button->setClickedCallback([=] {
const auto window = _controller->parentController();
@@ -717,15 +717,14 @@ void InnerWidget::refreshEmpty() {
object_ptr<Ui::RoundButton>(
empty.get(),
rpl::single(QString()),
st::collectionEmptyButton),
st::collectionEmptyButton,
Ui::RoundButtonTextNoTransform),
st::collectionEmptyAddMargin,
style::al_top);
button->setText(tr::lng_stories_album_add_button(
) | rpl::map([](const QString &text) {
return Ui::Text::IconEmoji(&st::collectionAddIcon).append(text);
}));
button->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
button->setClickedCallback([=] {
editAlbumStories(albumId);
});
@@ -230,8 +230,8 @@ void Widget::setupBottomButton(int wasBottomHeight) {
const auto button = Ui::CreateChild<Ui::RoundButton>(
bottom,
rpl::single(QString()),
st::collectionEditBox.button);
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::collectionEditBox.button,
Ui::RoundButtonTextNoTransform);
button->setText(tr::lng_stories_album_add_button(
) | rpl::map([](const QString &text) {
return Ui::Text::IconEmoji(&st::collectionAddIcon).append(text);
@@ -44,8 +44,8 @@ void ShowLayer(
const auto save = Ui::CreateChild<Ui::RoundButton>(
content.get(),
tr::lng_connection_save(),
st::userpicBuilderEmojiButton);
save->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::userpicBuilderEmojiButton,
Ui::RoundButtonTextNoTransform);
content->sizeValue(
) | rpl::on_next([=] {
const auto &p = st::userpicBuilderEmojiSavePosiiton;
@@ -512,9 +512,8 @@ void Inner::refreshSwitchPmButton(const CacheEntry *entry) {
_switchPmUrl = QByteArray();
} else {
if (!_switchPmButton) {
_switchPmButton.create(this, nullptr, st::switchPmButton);
_switchPmButton.create(this, nullptr, st::switchPmButton, Ui::RoundButtonTextNoTransform);
_switchPmButton->show();
_switchPmButton->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
_switchPmButton->addClickHandler([=] { switchPm(); });
}
_switchPmButton->setText(rpl::single(entry->switchPmText));
+8 -7
View File
@@ -84,10 +84,11 @@ Widget::Widget(
object_ptr<Ui::RoundButton>(
this,
tr::lng_menu_settings(),
st::defaultBoxButton))
st::defaultBoxButton,
Ui::RoundButtonTextToUpper))
, _next(
this,
object_ptr<Ui::RoundButton>(this, nullptr, *_nextStyle))
object_ptr<Ui::RoundButton>(this, nullptr, *_nextStyle, Ui::RoundButtonTextNoTransform))
, _connecting(std::make_unique<Window::ConnectionState>(
this,
account,
@@ -318,7 +319,8 @@ void Widget::checkUpdateStatus() {
object_ptr<Ui::RoundButton>(
this,
tr::lng_menu_update(),
st::defaultBoxButton));
st::defaultBoxButton,
Ui::RoundButtonTextToUpper));
if (!_showAnimation) {
_update->setVisible(true);
}
@@ -353,7 +355,7 @@ void Widget::setupStep() {
_next.destroy();
_next.create(
this,
object_ptr<Ui::RoundButton>(this, nullptr, *nextStyle));
object_ptr<Ui::RoundButton>(this, nullptr, *nextStyle, Ui::RoundButtonTextNoTransform));
showControls();
updateControlsGeometry();
_next->toggle(wasShown, anim::type::instant);
@@ -492,7 +494,8 @@ void Widget::showResetButton() {
auto entity = object_ptr<Ui::RoundButton>(
this,
tr::lng_signin_reset_account(),
st::introResetButton);
st::introResetButton,
Ui::RoundButtonTextToUpper);
_resetAccount.create(this, std::move(entity));
_resetAccount->hide(anim::type::instant);
_resetAccount->entity()->setClickedCallback([this] { resetAccount(); });
@@ -723,8 +726,6 @@ void Widget::showControls() {
void Widget::setupNextButton() {
_next->entity()->setClickedCallback([=] { getStep()->submit(); });
_next->entity()->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
_next->entity()->setText(getStep()->nextButtonText(
) | rpl::filter([](const QString &text) {
+2 -2
View File
@@ -97,14 +97,14 @@ public:
const auto reset = Ui::CreateChild<Ui::RoundButton>(
this,
rpl::single<QString>(QString()),
st::ivResetZoom);
st::ivResetZoom,
Ui::RoundButtonTextNoTransform);
processTooltip(reset);
const auto resetLabel = Ui::CreateChild<Ui::FlatLabel>(
reset,
tr::lng_background_reset_default(),
st::ivResetZoomLabel);
resetLabel->setAttribute(Qt::WA_TransparentForMouseEvents);
reset->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
reset->setClickedCallback([this] {
_delegate->ivSetZoom(0);
});
@@ -265,8 +265,8 @@ void Controller::Unsupported::setup(not_null<PeerData*> peer) {
_button = std::make_unique<Ui::RoundButton>(
wrap,
tr::lng_update_telegram(),
st::storiesUnsupportedUpdate);
_button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::storiesUnsupportedUpdate,
Ui::RoundButtonTextNoTransform);
_button->show();
rpl::combine(
@@ -240,7 +240,8 @@ struct State {
auto result = object_ptr<Ui::RoundButton>(
parent,
rpl::single(QString()),
st.box.button);
st.box.button,
Ui::RoundButtonTextToUpper);
const auto raw = result.data();
const auto label = Ui::CreateChild<Ui::FlatLabel>(
@@ -1791,12 +1791,11 @@ void OverlayWidget::refreshVoteButton() {
return;
}
if (!_voteButton) {
using TextTransform = Ui::RoundButton::TextTransform;
_voteButton.create(
_body,
tr::lng_polls_submit_votes(),
st::mediaviewVoteButton);
_voteButton->setTextTransform(TextTransform::NoTransform);
st::mediaviewVoteButton,
Ui::RoundButtonTextNoTransform);
const auto effect = Ui::CreateChild<QGraphicsOpacityEffect>(
_voteButton.data());
effect->setOpacity(_controlsOpacity.current());
@@ -4907,12 +4906,11 @@ void OverlayWidget::initThemePreview() {
_themePreviewId = 0;
_themePreview = std::move(result);
if (_themePreview) {
using TextTransform = Ui::RoundButton::TextTransform;
_themeApply.create(
_body,
tr::lng_theme_preview_apply(),
st::themePreviewApplyButton);
_themeApply->setTextTransform(TextTransform::NoTransform);
st::themePreviewApplyButton,
Ui::RoundButtonTextNoTransform);
_themeApply->show();
_themeApply->setClickedCallback([=] {
const auto &object = Background()->themeObject();
@@ -4928,16 +4926,16 @@ void OverlayWidget::initThemePreview() {
_themeCancel.create(
_body,
tr::lng_cancel(),
st::themePreviewCancelButton);
_themeCancel->setTextTransform(TextTransform::NoTransform);
st::themePreviewCancelButton,
Ui::RoundButtonTextNoTransform);
_themeCancel->show();
_themeCancel->setClickedCallback([this] { close(); });
if (const auto slug = _themeCloudData.slug; !slug.isEmpty()) {
_themeShare.create(
_body,
tr::lng_theme_share(),
st::themePreviewCancelButton);
_themeShare->setTextTransform(TextTransform::NoTransform);
st::themePreviewCancelButton,
Ui::RoundButtonTextNoTransform);
_themeShare->show();
_themeShare->setClickedCallback([=] {
QGuiApplication::clipboard()->setText(
@@ -325,13 +325,13 @@ PlaybackSponsored::Message::Message(
, _about(std::make_unique<Ui::RoundButton>(
this,
tr::lng_search_sponsored_button(),
_aboutSt))
_aboutSt,
Ui::RoundButtonTextNoTransform))
, _close(
std::make_unique<Close>(
this,
_aboutSt.ripple,
std::move(allowCloseAt))) {
_about->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
setMouseTracking(true);
populate();
hide();
+2 -1
View File
@@ -248,7 +248,8 @@ void AboutBox(
auto button = object_ptr<Ui::RoundButton>(
box,
tr::lng_box_ok(),
st::defaultActiveButton);
st::defaultActiveButton,
Ui::RoundButtonTextToUpper);
button->resizeToWidth(box->width()
- st.buttonPadding.left()
- st.buttonPadding.left());
@@ -141,15 +141,14 @@ void VerifyBox::setupControls(
object_ptr<Ui::RoundButton>(
_content,
tr::lng_intro_fragment_button(),
st::fragmentBoxButton),
st::fragmentBoxButton,
Ui::RoundButtonTextNoTransform),
small);
_content->widthValue(
) | rpl::on_next([=](int w) {
button->setFullWidth(w - small.left() - small.right());
}, button->lifetime());
button->setClickedCallback([=] { ::File::OpenUrl(openUrl); });
button->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
}
if (resend) {
auto link = TextWithEntities{ tr::lng_cloud_password_resend(tr::now) };
@@ -237,7 +236,8 @@ PanelEditContact::PanelEditContact(
, _done(
this,
tr::lng_passport_save_value(),
st::passportPanelSaveValue) {
st::passportPanelSaveValue,
Ui::RoundButtonTextToUpper) {
setupControls(data, existing);
}
@@ -221,7 +221,8 @@ PanelEditDocument::PanelEditDocument(
, _done(
this,
tr::lng_passport_save_value(),
st::passportPanelSaveValue) {
st::passportPanelSaveValue,
Ui::RoundButtonTextToUpper) {
setupControls(
&error,
&data,
@@ -247,7 +248,8 @@ PanelEditDocument::PanelEditDocument(
, _done(
this,
tr::lng_passport_save_value(),
st::passportPanelSaveValue) {
st::passportPanelSaveValue,
Ui::RoundButtonTextToUpper) {
setupControls(
nullptr,
nullptr,
@@ -270,7 +272,8 @@ PanelEditDocument::PanelEditDocument(
, _done(
this,
tr::lng_passport_save_value(),
st::passportPanelSaveValue) {
st::passportPanelSaveValue,
Ui::RoundButtonTextToUpper) {
setupControls(&error, &data, nullptr, nullptr, {}, {}, {});
}
@@ -326,7 +326,8 @@ ScanButton::ScanButton(
object_ptr<Ui::RoundButton>(
this,
tr::lng_passport_delete_scan_undo(),
_st.restore)) {
_st.restore,
Ui::RoundButtonTextToUpper)) {
_delete->toggle(!deleted, anim::type::instant);
_restore->toggle(deleted, anim::type::instant);
}
@@ -40,7 +40,8 @@ PanelForm::PanelForm(
, _submit(
this,
tr::lng_passport_authorize(),
st::passportPanelAuthorize) {
st::passportPanelAuthorize,
Ui::RoundButtonTextToUpper) {
setupControls();
}
@@ -47,7 +47,7 @@ PanelAskPassword::PanelAskPassword(
this,
st::defaultInputField,
tr::lng_passport_password_placeholder())
, _submit(this, tr::lng_passport_next(), st::passportPasswordSubmit)
, _submit(this, tr::lng_passport_next(), st::passportPasswordSubmit, Ui::RoundButtonTextToUpper)
, _forgot(this, tr::lng_signin_recover(tr::now), st::defaultLinkButton) {
connect(_password, &Ui::PasswordInput::submitted, this, [=] {
submit();
@@ -227,7 +227,8 @@ void PanelNoPassword::refreshBottom() {
object_ptr<Ui::RoundButton>(
_inner,
tr::lng_passport_password_create(),
st::defaultBoxButton),
st::defaultBoxButton,
Ui::RoundButtonTextToUpper),
style::al_top);
button->addClickHandler([=] {
_controller->setupPassword();
@@ -240,18 +241,16 @@ void PanelNoPassword::refreshBottom() {
const auto cancel = Ui::CreateChild<Ui::RoundButton>(
container,
tr::lng_cancel(),
st::defaultBoxButton);
cancel->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
st::defaultBoxButton,
Ui::RoundButtonTextNoTransform);
cancel->addClickHandler([=] {
_controller->cancelPasswordSubmit();
});
const auto validate = Ui::CreateChild<Ui::RoundButton>(
container,
tr::lng_passport_email_validate(),
st::defaultBoxButton);
validate->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
st::defaultBoxButton,
Ui::RoundButtonTextNoTransform);
validate->addClickHandler([=] {
_controller->validateRecoveryEmail();
});
@@ -216,11 +216,13 @@ EditCard::EditCard(
, _submit(
this,
tr::lng_about_done(),
st::paymentsPanelButton)
st::paymentsPanelButton,
RoundButtonTextToUpper)
, _cancel(
this,
tr::lng_cancel(),
st::paymentsPanelButton) {
st::paymentsPanelButton,
RoundButtonTextToUpper) {
setupControls();
}
@@ -47,11 +47,13 @@ EditInformation::EditInformation(
, _submit(
this,
tr::lng_settings_save(),
st::paymentsPanelButton)
st::paymentsPanelButton,
RoundButtonTextToUpper)
, _cancel(
this,
tr::lng_cancel(),
st::paymentsPanelButton) {
st::paymentsPanelButton,
RoundButtonTextToUpper) {
setupControls();
}
@@ -83,13 +83,15 @@ FormSummary::FormSummary(
tr::lng_payments_pay_amount(
lt_amount,
rpl::single(formatAmount(computeTotalAmount()))),
st::paymentsPanelSubmit))
st::paymentsPanelSubmit,
RoundButtonTextNoTransform))
, _cancel(
this,
(_invoice.receipt.paid
? tr::lng_about_done()
: tr::lng_cancel()),
st::paymentsPanelButton)
st::paymentsPanelButton,
RoundButtonTextNoTransform)
, _tipLightBg(TransparentColor(st::paymentsTipActive, kLightOpacity))
, _tipLightRipple(
TransparentColor(st::paymentsTipActive, kLightRippleOpacity))
@@ -170,13 +172,10 @@ void FormSummary::setupControls() {
setupContent(_layout.get());
if (_submit) {
_submit->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
_submit->addClickHandler([=] {
_delegate->panelSubmit();
});
}
_cancel->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
_cancel->addClickHandler([=] {
_delegate->panelRequestClose();
});
@@ -398,7 +397,8 @@ void FormSummary::setupSuggestedTips(not_null<VerticalLayout*> layout) {
.widget = CreateChild<RoundButton>(
outer,
rpl::single(formatAmount(amount, true)),
st),
st,
RoundButtonTextNoTransform),
});
auto &button = state->buttons.back();
button.widget->show();
@@ -229,10 +229,10 @@ not_null<Ui::RoundButton*> AddDoneButton(
object_ptr<Ui::RoundButton>(
content,
std::move(text),
st::changePhoneButton),
st::changePhoneButton,
Ui::RoundButtonTextNoTransform),
st::settingLocalPasscodeButtonPadding,
style::al_top);
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
return button;
}
@@ -496,7 +496,8 @@ void Credits::setupContent() {
object_ptr<Ui::RoundButton>(
content,
nullptr,
st::creditsSettingsBigBalanceButton),
st::creditsSettingsBigBalanceButton,
Ui::RoundButtonTextNoTransform),
st::boxRowPadding,
style::al_top);
button->setContext([&]() -> Ui::Text::MarkedContext {
@@ -534,7 +535,6 @@ void Credits::setupContent() {
lt_emoji,
rpl::single(Ui::Text::SingleCustomEmoji(u"+"_q)),
tr::marked)));
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
const auto show = controller()->uiShow();
if (isCurrency) {
const auto url = tr::lng_suggest_low_ton_fragment_url(tr::now);
@@ -866,7 +866,8 @@ void BuildCurrencyWithdrawalSection(
object_ptr<Ui::RoundButton>(
container,
rpl::never<QString>(),
stButton),
stButton,
Ui::RoundButtonTextToUpper),
st::boxRowPadding,
style::al_top);
@@ -180,15 +180,14 @@ FilterRowButton::FilterRowButton(
: RippleButton(parent, st::defaultRippleAnimation)
, _session(session)
, _remove(this, st::filtersRemove)
, _restore(this, tr::lng_filters_restore(), st::settingsFilterAddRecommended)
, _restore(this, tr::lng_filters_restore(), st::settingsFilterAddRecommended, Ui::RoundButtonTextNoTransform)
, _add(
this,
tr::lng_filters_recommended_add(),
st::settingsFilterAddRecommended)
st::settingsFilterAddRecommended,
Ui::RoundButtonTextNoTransform)
, _state(description.isEmpty() ? State::Normal : State::Suggested) {
_restore.setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
_restore.setFullRadius(true);
_add.setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
_add.setFullRadius(true);
setup(filter, description.isEmpty()
? ComputeCountString(session, filter)
@@ -209,10 +209,10 @@ void LocalPasscodeEnter::setupContent() {
: isCheck
? tr::lng_passcode_check_button()
: tr::lng_passcode_change_button()),
st::changePhoneButton),
st::changePhoneButton,
Ui::RoundButtonTextNoTransform),
st::settingLocalPasscodeButtonPadding,
style::al_top);
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
button->setClickedCallback([=] {
const auto newText = newPasscode->text();
const auto reenterText = reenterPasscode
@@ -852,8 +852,8 @@ void SetupValidatePhoneNumberSuggestion(
const auto yes = Ui::CreateChild<Ui::RoundButton>(
wrap,
tr::lng_box_yes(),
st::inviteLinkButton);
yes->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::inviteLinkButton,
Ui::RoundButtonTextNoTransform);
yes->setClickedCallback([=] {
controller->session().promoSuggestions().dismiss(
kSugValidatePhone.utf8());
@@ -862,8 +862,8 @@ void SetupValidatePhoneNumberSuggestion(
const auto no = Ui::CreateChild<Ui::RoundButton>(
wrap,
tr::lng_box_no(),
st::inviteLinkButton);
no->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::inviteLinkButton,
Ui::RoundButtonTextNoTransform);
no->setClickedCallback([=] {
const auto sharedLabel = std::make_shared<base::weak_qptr<Ui::FlatLabel>>();
const auto height = st::boxLabel.style.font->height;
@@ -954,8 +954,8 @@ void SetupValidatePasswordSuggestion(
const auto yes = Ui::CreateChild<Ui::RoundButton>(
wrap,
tr::lng_settings_suggestion_password_yes(),
st::inviteLinkButton);
yes->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::inviteLinkButton,
Ui::RoundButtonTextNoTransform);
yes->setClickedCallback([=] {
controller->session().promoSuggestions().dismiss(
Data::PromoSuggestions::SugValidatePassword());
@@ -964,8 +964,8 @@ void SetupValidatePasswordSuggestion(
const auto no = Ui::CreateChild<Ui::RoundButton>(
wrap,
tr::lng_settings_suggestion_password_no(),
st::inviteLinkButton);
no->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::inviteLinkButton,
Ui::RoundButtonTextNoTransform);
no->setClickedCallback([=] {
showOther(Settings::CloudPasswordSuggestionInputId());
});
@@ -453,9 +453,9 @@ void PasskeysNoneBox(
canRegister
? tr::lng_settings_passkeys_none_button()
: tr::lng_settings_passkeys_none_button_unsupported(),
st::defaultActiveButton);
st::defaultActiveButton,
Ui::RoundButtonTextNoTransform);
const auto createButton = button.data();
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
button->resizeToWidth(box->width()
- st.buttonPadding.left()
- st.buttonPadding.left());
@@ -1937,11 +1937,13 @@ not_null<Ui::RoundButton*> CreateLockedButton(
not_null<QWidget*> parent,
rpl::producer<QString> text,
const style::RoundButton &st,
Ui::RoundButtonTextTransform transform,
rpl::producer<bool> locked) {
const auto result = Ui::CreateChild<Ui::RoundButton>(
parent.get(),
rpl::single(QString()),
st);
st,
transform);
const auto labelSt = result->lifetime().make_state<style::FlatLabel>(
st::defaultFlatLabel);
@@ -17,6 +17,10 @@ namespace style {
struct RoundButton;
} // namespace style
namespace Ui {
enum class RoundButtonTextTransform : uchar;
} // namespace Ui
namespace ChatHelpers {
class Show;
} // namespace ChatHelpers
@@ -93,6 +97,7 @@ struct SubscribeButtonArgs final {
not_null<QWidget*> parent,
rpl::producer<QString> text,
const style::RoundButton &st,
Ui::RoundButtonTextTransform transform,
rpl::producer<bool> locked);
[[nodiscard]] not_null<Ui::GradientButton*> CreateSubscribeButton(
@@ -3340,14 +3340,14 @@ void AddWithdrawalWidget(
const auto button = Ui::CreateChild<Ui::RoundButton>(
buttonsContainer,
rpl::never<QString>(),
stButton);
stButton,
Ui::RoundButtonTextToUpper);
const auto buttonCredits = Ui::CreateChild<Ui::RoundButton>(
buttonsContainer,
tr::lng_bot_earn_balance_button_buy_ads(),
stButton);
buttonCredits->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
stButton,
Ui::RoundButtonTextNoTransform);
{
const auto icon = Ui::CreateChild<Ui::RpWidget>(buttonCredits);
const auto &st = st::msgBotKbUrlIcon;
@@ -1319,13 +1319,12 @@ void ChartWidget::processLocalZoom(int xIndex) {
const auto zoomOutButton = Ui::CreateChild<Ui::RoundButton>(
header,
tr::lng_stats_zoom_out(),
st::statisticsHeaderButton);
st::statisticsHeaderButton,
Ui::RoundButtonTextNoTransform);
zoomOutButton->moveToRight(
0,
(header->height() - zoomOutButton->height()) / 2);
zoomOutButton->show();
zoomOutButton->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
zoomOutButton->setClickedCallback([=] {
auto lifetime = _localZoomLifetime.make_state<rpl::lifetime>();
const auto animation = lifetime->make_state<Ui::Animations::Simple>();
@@ -1533,9 +1532,8 @@ void ChartWidget::setZoomedChartData(
const auto zoomOutButton = Ui::CreateChild<Ui::RoundButton>(
customHeader,
tr::lng_stats_zoom_out(),
st::statisticsHeaderButton);
zoomOutButton->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
st::statisticsHeaderButton,
Ui::RoundButtonTextNoTransform);
zoomOutButton->moveToRight(
0,
(customHeader->height() - zoomOutButton->height()) / 2);
@@ -230,9 +230,9 @@ void CollectibleInfoBox(
object_ptr<Ui::RoundButton>(
box,
tr::lng_collectible_learn_more(),
st::collectibleMore),
st::collectibleMore,
RoundButtonTextNoTransform),
st::collectibleMorePadding);
more->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
more->setClickedCallback([url = info.url] {
File::OpenUrl(url);
});
@@ -243,9 +243,9 @@ void CollectibleInfoBox(
auto owned = object_ptr<Ui::RoundButton>(
box,
phrase(),
st::collectibleCopy);
st::collectibleCopy,
RoundButtonTextNoTransform);
const auto copy = owned.data();
copy->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
copy->setClickedCallback([copyCallback] {
copyCallback(true);
});
@@ -32,10 +32,9 @@ ConfirmPhoneBox::ConfirmPhoneBox(
_fragment.create(
this,
tr::lng_intro_fragment_button(),
st::fragmentBoxButton);
st::fragmentBoxButton,
RoundButtonTextNoTransform);
_fragment->setClickedCallback([=] { File::OpenUrl(openUrl); });
_fragment->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
}
if (timeout) {
_call.setStatus({ Ui::SentCodeCall::State::Waiting, *timeout });
@@ -386,7 +386,8 @@ void AddStakePresets(
const auto button = CreateChild<RoundButton>(
wrap,
rpl::single(FormatTonAmount(nanoTon).full + diamond),
st::stakePresetButton);
st::stakePresetButton,
RoundButtonTextToUpper);
button->setClickedCallback([=] {
callback(nanoTon);
});
@@ -157,9 +157,9 @@ void ShowOrPremiumBox(
object_ptr<RoundButton>(
box,
std::move(skin.showButton),
st::showOrShowButton),
st::showOrShowButton,
RoundButtonTextNoTransform),
buttonPadding);
show->setTextTransform(RoundButton::TextTransform::NoTransform);
box->addRow(
MakeShowOrLabel(box, std::move(skin.orPremium)),
st::showOrLabelPadding + buttonPadding,
@@ -291,13 +291,13 @@ void ChooseThemeController::initButtons() {
const auto apply = CreateChild<RoundButton>(
controls,
tr::lng_chat_theme_apply(),
st::defaultLightButton);
apply->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::defaultLightButton,
RoundButtonTextNoTransform);
const auto choose = CreateChild<RoundButton>(
controls,
tr::lng_chat_theme_change_wallpaper(),
st::defaultLightButton);
choose->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
st::defaultLightButton,
RoundButtonTextNoTransform);
const auto &margin = st::chatThemeButtonMargin;
controls->resize(
@@ -190,8 +190,8 @@ void GroupCallBar::refreshScheduledProcess() {
_join = std::make_unique<RoundButton>(
_inner.get(),
tr::lng_group_call_join(),
st::groupCallTopBarJoin);
_join->setTextTransform(RoundButton::TextTransform::NoTransform);
st::groupCallTopBarJoin,
RoundButtonTextNoTransform);
setupRightButton(_join.get());
}
} else if (!_scheduledProcess) {
@@ -200,7 +200,8 @@ void GroupCallBar::refreshScheduledProcess() {
_open = std::make_unique<RoundButton>(
_inner.get(),
_scheduledProcess->text(GroupCallScheduledLeft::Negative::Show),
st::groupCallTopBarOpen);
st::groupCallTopBarOpen,
RoundButtonTextToUpper);
setupRightButton(_open.get());
_open->widthValue(
) | rpl::on_next([=] {
@@ -494,7 +494,7 @@ object_ptr<RoundButton> FilterLinkProcessButton(
rpl::producer<int> badge) {
const auto st = &st::filterInviteBox.button;
const auto badgeSt = &st::filterInviteButtonBadgeStyle;
auto result = object_ptr<RoundButton>(parent, rpl::single(u""_q), *st);
auto result = object_ptr<RoundButton>(parent, rpl::single(u""_q), *st, RoundButtonTextToUpper);
struct Data {
TextWithEntities text;
@@ -41,14 +41,14 @@ void AddCopyShareLinkButtons(
const auto copy = CreateChild<RoundButton>(
wrap,
tr::lng_group_invite_copy(),
st::inviteLinkCopy);
copy->setTextTransform(RoundButton::TextTransform::NoTransform);
st::inviteLinkCopy,
RoundButtonTextNoTransform);
copy->setClickedCallback(copyLink);
const auto share = CreateChild<RoundButton>(
wrap,
tr::lng_group_invite_share(),
st::inviteLinkShare);
share->setTextTransform(RoundButton::TextTransform::NoTransform);
st::inviteLinkShare,
RoundButtonTextNoTransform);
share->setClickedCallback(shareLink);
wrap->widthValue(
@@ -69,9 +69,9 @@ void AddReactivateLinkButton(
object_ptr<RoundButton>(
container,
tr::lng_group_invite_reactivate(),
st::inviteLinkReactivate),
st::inviteLinkReactivate,
RoundButtonTextNoTransform),
st::inviteLinkButtonsPadding);
button->setTextTransform(RoundButton::TextTransform::NoTransform);
button->setClickedCallback(editLink);
}
@@ -82,9 +82,9 @@ void AddDeleteLinkButton(
object_ptr<RoundButton>(
container,
tr::lng_group_invite_delete(),
st::inviteLinkDelete),
st::inviteLinkDelete,
RoundButtonTextNoTransform),
st::inviteLinkButtonsPadding);
button->setTextTransform(RoundButton::TextTransform::NoTransform);
button->setClickedCallback(deleteLink);
}
@@ -686,9 +686,9 @@ not_null<RpWidget*> SetupMapPlaceholder(
const auto button = CreateChild<RoundButton>(
result,
tr::lng_maps_select_on_map(),
st::pickLocationChooseOnMap);
st::pickLocationChooseOnMap,
RoundButtonTextNoTransform);
button->setFullRadius(true);
button->setTextTransform(RoundButton::TextTransform::NoTransform);
button->setClickedCallback(choose);
parent->sizeValue() | rpl::on_next([=](QSize size) {
@@ -109,8 +109,8 @@ ValueWithSmallButton MakeValueWithSmallButton(
const auto button = CreateChild<RoundButton>(
raw,
std::move(buttonText),
table->st().smallButton);
button->setTextTransform(RoundButton::TextTransform::NoTransform);
table->st().smallButton,
RoundButtonTextNoTransform);
if (handler) {
button->setClickedCallback([button, handler = std::move(handler)] {
handler(button);
@@ -660,7 +660,7 @@ Notification::Notification(
, _forwardedCount(forwardedCount)
, _fromScheduled(fromScheduled)
, _close(this, st::notifyClose)
, _reply(this, tr::lng_notification_reply(), st::defaultBoxButton) {
, _reply(this, tr::lng_notification_reply(), st::defaultBoxButton, Ui::RoundButtonTextToUpper) {
Lang::Updated(
) | rpl::on_next([=] {
refreshLang();
@@ -29,12 +29,9 @@ WarningWidget::WarningWidget(QWidget *parent)
: RpWidget(parent)
, _timer([=] { handleTimer(); })
, _secondsLeft(kWaitBeforeRevertMs / 1000)
, _keepChanges(this, tr::lng_theme_keep_changes(), st::defaultBoxButton)
, _revert(this, tr::lng_theme_revert(), st::defaultBoxButton) {
using TextTransform = Ui::RoundButton::TextTransform;
_keepChanges->setTextTransform(TextTransform::NoTransform);
, _keepChanges(this, tr::lng_theme_keep_changes(), st::defaultBoxButton, Ui::RoundButtonTextNoTransform)
, _revert(this, tr::lng_theme_revert(), st::defaultBoxButton, Ui::RoundButtonTextNoTransform) {
_keepChanges->setClickedCallback([] { KeepApplied(); });
_revert->setTextTransform(TextTransform::NoTransform);
_revert->setClickedCallback([] { Revert(); });
updateText();
}
@@ -98,12 +98,10 @@ PasscodeLockWidget::PasscodeLockWidget(
not_null<Controller*> window)
: LockWidget(parent, window)
, _passcode(this, st::passcodeInput, tr::lng_passcode_ph())
, _submit(this, tr::lng_passcode_submit(), st::passcodeSubmit)
, _submit(this, tr::lng_passcode_submit(), st::passcodeSubmit, Ui::RoundButtonTextNoTransform)
, _logout(this, tr::lng_passcode_logout(tr::now)) {
connect(_passcode, &Ui::MaskedInputField::changed, [=] { changed(); });
connect(_passcode, &Ui::MaskedInputField::submitted, [=] { submit(); });
_submit->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
_submit->setClickedCallback([=] { submit(); });
_logout->setClickedCallback([=] {
window->showLogoutConfirmation();
@@ -125,9 +125,8 @@ SetupEmailLockWidget::SetupEmailLockWidget(
_logoutButton = object_ptr<Ui::RoundButton>(
this,
tr::lng_settings_logout(),
st::defaultBoxButton);
_logoutButton->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
st::defaultBoxButton,
Ui::RoundButtonTextNoTransform);
if (session) {
session->promoSuggestions().setSetupEmailState(
Data::SetupEmailState::SettingUpNoSkip);
@@ -151,9 +150,8 @@ SetupEmailLockWidget::SetupEmailLockWidget(
_debugButton = object_ptr<Ui::RoundButton>(
this,
rpl::single(u"[DEBUG] Clear bio"_q),
st::defaultBoxButton);
_debugButton->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
st::defaultBoxButton,
Ui::RoundButtonTextNoTransform);
_debugButton->setClickedCallback([=] {
session->api().saveSelfBio({});
});
@@ -227,11 +225,10 @@ SetupEmailLockWidget::SetupEmailLockWidget(
object_ptr<Ui::RoundButton>(
_layout,
tr::lng_settings_cloud_login_email_confirm(),
st::changePhoneButton),
st::changePhoneButton,
Ui::RoundButtonTextNoTransform),
st::boxRowPadding,
style::al_top);
submit->setTextTransform(
Ui::RoundButton::TextTransform::NoTransform);
_emailInput = emailInput;
_errorLabel = errorLabel;