Replaced RoundButton text transform constructor arg with setter.

This commit is contained in:
23rd
2026-04-06 16:35:37 +03:00
parent 494833236f
commit 9cb41f4517
26 changed files with 84 additions and 82 deletions
@@ -2424,13 +2424,13 @@ void EditPeerColorBox(
const auto profileButton = Ui::CreateChild<Ui::RoundButton>(
buttonContainer,
tr::lng_settings_color_apply(),
box->getDelegate()->style().button,
Ui::RoundButtonTextToUpper);
box->getDelegate()->style().button);
profileButton->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
const auto nameButton = Ui::CreateChild<Ui::RoundButton>(
buttonContainer,
tr::lng_settings_color_apply(),
box->getDelegate()->style().button,
Ui::RoundButtonTextToUpper);
box->getDelegate()->style().button);
nameButton->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
rpl::combine(
buttonContainer->widthValue(),
profileButton->sizeValue(),
@@ -260,20 +260,20 @@ ChooseSourceProcess::ChooseSourceProcess(
CreateChild<RoundButton>(
_bottom.get(),
tr::lng_group_call_screen_share_start(),
st::desktopCaptureSubmit,
RoundButtonTextToUpper))
st::desktopCaptureSubmit))
, _finish(
CreateChild<RoundButton>(
_bottom.get(),
tr::lng_group_call_screen_share_stop(),
st::desktopCaptureFinish,
RoundButtonTextToUpper))
st::desktopCaptureFinish))
, _withAudio(
CreateChild<Checkbox>(
_bottom.get(),
tr::lng_group_call_screen_share_audio(tr::now),
false,
st::desktopCaptureWithAudio)) {
_submit->setTextTransform(RoundButtonTextTransform::ToUpper);
_finish->setTextTransform(RoundButtonTextTransform::ToUpper);
setupPanel();
setupSources();
activate();
@@ -371,8 +371,8 @@ void ChooseSourceProcess::setupPanel() {
const auto cancel = CreateChild<RoundButton>(
_bottom.get(),
tr::lng_cancel(),
st::desktopCaptureCancel,
RoundButtonTextToUpper);
st::desktopCaptureCancel);
cancel->setTextTransform(RoundButtonTextTransform::ToUpper);
cancel->setClickedCallback([=] {
_window->close();
});
@@ -117,10 +117,10 @@ TopBarWidget::TopBarWidget(
: RpWidget(parent)
, _controller(controller)
, _primaryWindow(controller->isPrimary())
, _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)
, _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)
, _back(this, st::historyTopBarBack)
, _cancelChoose(this, st::topBarCloseChoose)
, _call(this, st::topBarCall)
@@ -132,6 +132,11 @@ TopBarWidget::TopBarWidget(
, _onlineUpdater([=] { updateOnlineDisplay(); }) {
setAttribute(Qt::WA_OpaquePaintEvent);
_clear->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
_forward->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
_sendNow->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
_delete->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
Lang::Updated(
) | rpl::on_next([=] {
refreshLang();
@@ -447,9 +447,9 @@ private:
auto result = object_ptr<Ui::RoundButton>(
parent,
rpl::single(QString()),
st::starrefBottomButton,
Ui::RoundButtonTextToUpper);
st::starrefBottomButton);
const auto raw = result.data();
raw->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
rpl::combine(
parent->widthValue(),
raw->widthValue()
@@ -144,9 +144,9 @@ void AddRecipient(not_null<Ui::GenericBox*> box, const TextWithEntities &t) {
object_ptr<Ui::RoundButton>(
box,
rpl::single(QString()),
st::channelEarnHistoryRecipientButton,
Ui::RoundButtonTextToUpper),
st::channelEarnHistoryRecipientButton),
style::al_top);
container->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
const auto label = Ui::CreateChild<Ui::FlatLabel>(
container,
rpl::single(t),
@@ -883,10 +883,10 @@ void InnerWidget::fill() {
object_ptr<Ui::RoundButton>(
container,
rpl::never<QString>(),
stButton,
Ui::RoundButtonTextToUpper),
stButton),
st::boxRowPadding,
style::al_justify);
button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
const auto label = Ui::CreateChild<Ui::FlatLabel>(
button,
@@ -1236,8 +1236,8 @@ void InnerWidget::fill() {
(!entry.successLink.isEmpty())
? tr::lng_channel_earn_history_out_button()
: tr::lng_box_ok(),
st::defaultActiveButton,
Ui::RoundButtonTextToUpper);
st::defaultActiveButton);
button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
button->resizeToWidth(box->width()
- st.buttonPadding.left()
- st.buttonPadding.left());
@@ -394,10 +394,10 @@ base::options::toggle ShowChannelJoinedBelowAbout({
object_ptr<Ui::RoundButton>(
parent,
rpl::single(QString()),
st::infoHoursOuter,
Ui::RoundButtonTextToUpper),
st::infoHoursOuter),
st::infoProfileLabeledPadding - st::infoHoursOuterMargin);
const auto button = result->entity();
button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
const auto inner = Ui::CreateChild<Ui::VerticalLayout>(button);
button->widthValue() | rpl::on_next([=](int width) {
const auto margin = st::infoHoursOuterMargin;
@@ -882,11 +882,11 @@ void DeleteContactNote(
object_ptr<Ui::RoundButton>(
parent,
rpl::single(QString()),
st::infoHoursOuter,
Ui::RoundButtonTextToUpper),
st::infoHoursOuter),
st::infoProfileLabeledPadding - st::infoHoursOuterMargin);
result->setDuration(st::infoSlideDuration);
const auto button = result->entity();
button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
auto outer = Ui::CreateChild<Ui::SlideWrap<Ui::VerticalLayout>>(
button,
@@ -156,8 +156,8 @@ void ListController::setupUnlock() {
? tr::lng_similar_channels_show_more()
: tr::lng_similar_bots_show_more()),
st::similarChannelsLock,
rpl::single(true),
Ui::RoundButtonTextToUpper);
rpl::single(true));
button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
button->setClickedCallback([=] {
const auto window = _controller->parentController();
::Settings::ShowPremium(window, u"similar_channels"_q);
+6 -6
View File
@@ -84,8 +84,7 @@ Widget::Widget(
object_ptr<Ui::RoundButton>(
this,
tr::lng_menu_settings(),
st::defaultBoxButton,
Ui::RoundButtonTextToUpper))
st::defaultBoxButton))
, _next(
this,
object_ptr<Ui::RoundButton>(this, nullptr, *_nextStyle))
@@ -93,6 +92,7 @@ Widget::Widget(
this,
account,
rpl::single(true))) {
_settings->entity()->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
controller->setDefaultFloatPlayerDelegate(floatPlayerDelegate());
getData()->country = ComputeNewAccountCountry();
@@ -319,8 +319,8 @@ void Widget::checkUpdateStatus() {
object_ptr<Ui::RoundButton>(
this,
tr::lng_menu_update(),
st::defaultBoxButton,
Ui::RoundButtonTextToUpper));
st::defaultBoxButton));
_update->entity()->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
if (!_showAnimation) {
_update->setVisible(true);
}
@@ -494,8 +494,8 @@ void Widget::showResetButton() {
auto entity = object_ptr<Ui::RoundButton>(
this,
tr::lng_signin_reset_account(),
st::introResetButton,
Ui::RoundButtonTextToUpper);
st::introResetButton);
entity->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
_resetAccount.create(this, std::move(entity));
_resetAccount->hide(anim::type::instant);
_resetAccount->entity()->setClickedCallback([this] { resetAccount(); });
@@ -240,9 +240,9 @@ struct State {
auto result = object_ptr<Ui::RoundButton>(
parent,
rpl::single(QString()),
st.box.button,
Ui::RoundButtonTextToUpper);
st.box.button);
const auto raw = result.data();
raw->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
const auto label = Ui::CreateChild<Ui::FlatLabel>(
raw,
+2 -2
View File
@@ -248,8 +248,8 @@ void AboutBox(
auto button = object_ptr<Ui::RoundButton>(
box,
tr::lng_box_ok(),
st::defaultActiveButton,
Ui::RoundButtonTextToUpper);
st::defaultActiveButton);
button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
button->resizeToWidth(box->width()
- st.buttonPadding.left()
- st.buttonPadding.left());
@@ -235,8 +235,8 @@ PanelEditContact::PanelEditContact(
, _done(
this,
tr::lng_passport_save_value(),
st::passportPanelSaveValue,
Ui::RoundButtonTextToUpper) {
st::passportPanelSaveValue) {
_done->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
setupControls(data, existing);
}
@@ -221,8 +221,8 @@ PanelEditDocument::PanelEditDocument(
, _done(
this,
tr::lng_passport_save_value(),
st::passportPanelSaveValue,
Ui::RoundButtonTextToUpper) {
st::passportPanelSaveValue) {
_done->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
setupControls(
&error,
&data,
@@ -248,8 +248,8 @@ PanelEditDocument::PanelEditDocument(
, _done(
this,
tr::lng_passport_save_value(),
st::passportPanelSaveValue,
Ui::RoundButtonTextToUpper) {
st::passportPanelSaveValue) {
_done->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
setupControls(
nullptr,
nullptr,
@@ -272,8 +272,8 @@ PanelEditDocument::PanelEditDocument(
, _done(
this,
tr::lng_passport_save_value(),
st::passportPanelSaveValue,
Ui::RoundButtonTextToUpper) {
st::passportPanelSaveValue) {
_done->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
setupControls(&error, &data, nullptr, nullptr, {}, {}, {});
}
@@ -326,8 +326,8 @@ ScanButton::ScanButton(
object_ptr<Ui::RoundButton>(
this,
tr::lng_passport_delete_scan_undo(),
_st.restore,
Ui::RoundButtonTextToUpper)) {
_st.restore)) {
_restore->entity()->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
_delete->toggle(!deleted, anim::type::instant);
_restore->toggle(deleted, anim::type::instant);
}
@@ -40,8 +40,8 @@ PanelForm::PanelForm(
, _submit(
this,
tr::lng_passport_authorize(),
st::passportPanelAuthorize,
Ui::RoundButtonTextToUpper) {
st::passportPanelAuthorize) {
_submit->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
setupControls();
}
@@ -47,8 +47,9 @@ PanelAskPassword::PanelAskPassword(
this,
st::defaultInputField,
tr::lng_passport_password_placeholder())
, _submit(this, tr::lng_passport_next(), st::passportPasswordSubmit, Ui::RoundButtonTextToUpper)
, _submit(this, tr::lng_passport_next(), st::passportPasswordSubmit)
, _forgot(this, tr::lng_signin_recover(tr::now), st::defaultLinkButton) {
_submit->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
connect(_password, &Ui::PasswordInput::submitted, this, [=] {
submit();
});
@@ -227,9 +228,9 @@ void PanelNoPassword::refreshBottom() {
object_ptr<Ui::RoundButton>(
_inner,
tr::lng_passport_password_create(),
st::defaultBoxButton,
Ui::RoundButtonTextToUpper),
st::defaultBoxButton),
style::al_top);
button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
button->addClickHandler([=] {
_controller->setupPassword();
});
@@ -216,13 +216,13 @@ EditCard::EditCard(
, _submit(
this,
tr::lng_about_done(),
st::paymentsPanelButton,
RoundButtonTextToUpper)
st::paymentsPanelButton)
, _cancel(
this,
tr::lng_cancel(),
st::paymentsPanelButton,
RoundButtonTextToUpper) {
st::paymentsPanelButton) {
_submit->setTextTransform(RoundButtonTextTransform::ToUpper);
_cancel->setTextTransform(RoundButtonTextTransform::ToUpper);
setupControls();
}
@@ -47,13 +47,13 @@ EditInformation::EditInformation(
, _submit(
this,
tr::lng_settings_save(),
st::paymentsPanelButton,
RoundButtonTextToUpper)
st::paymentsPanelButton)
, _cancel(
this,
tr::lng_cancel(),
st::paymentsPanelButton,
RoundButtonTextToUpper) {
st::paymentsPanelButton) {
_submit->setTextTransform(RoundButtonTextTransform::ToUpper);
_cancel->setTextTransform(RoundButtonTextTransform::ToUpper);
setupControls();
}
@@ -865,10 +865,10 @@ void BuildCurrencyWithdrawalSection(
object_ptr<Ui::RoundButton>(
container,
rpl::never<QString>(),
stButton,
Ui::RoundButtonTextToUpper),
stButton),
st::boxRowPadding,
style::al_top);
button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
const auto label = Ui::CreateChild<Ui::FlatLabel>(
button,
@@ -1937,13 +1937,11 @@ not_null<Ui::RoundButton*> CreateLockedButton(
not_null<QWidget*> parent,
rpl::producer<QString> text,
const style::RoundButton &st,
rpl::producer<bool> locked,
Ui::RoundButtonTextTransform transform) {
rpl::producer<bool> locked) {
const auto result = Ui::CreateChild<Ui::RoundButton>(
parent.get(),
rpl::single(QString()),
st,
transform);
st);
const auto labelSt = result->lifetime().make_state<style::FlatLabel>(
st::defaultFlatLabel);
@@ -17,10 +17,6 @@ namespace style {
struct RoundButton;
} // namespace style
namespace Ui {
enum class RoundButtonTextTransform : uchar;
} // namespace Ui
namespace ChatHelpers {
class Show;
} // namespace ChatHelpers
@@ -97,8 +93,7 @@ struct SubscribeButtonArgs final {
not_null<QWidget*> parent,
rpl::producer<QString> text,
const style::RoundButton &st,
rpl::producer<bool> locked,
Ui::RoundButtonTextTransform transform = Ui::RoundButtonTextTransform{});
rpl::producer<bool> locked);
[[nodiscard]] not_null<Ui::GradientButton*> CreateSubscribeButton(
SubscribeButtonArgs &&args);
@@ -3340,8 +3340,8 @@ void AddWithdrawalWidget(
const auto button = Ui::CreateChild<Ui::RoundButton>(
buttonsContainer,
rpl::never<QString>(),
stButton,
Ui::RoundButtonTextToUpper);
stButton);
button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
const auto buttonCredits = Ui::CreateChild<Ui::RoundButton>(
buttonsContainer,
@@ -386,8 +386,8 @@ void AddStakePresets(
const auto button = CreateChild<RoundButton>(
wrap,
rpl::single(FormatTonAmount(nanoTon).full + diamond),
st::stakePresetButton,
RoundButtonTextToUpper);
st::stakePresetButton);
button->setTextTransform(RoundButtonTextTransform::ToUpper);
button->setClickedCallback([=] {
callback(nanoTon);
});
@@ -199,8 +199,8 @@ void GroupCallBar::refreshScheduledProcess() {
_open = std::make_unique<RoundButton>(
_inner.get(),
_scheduledProcess->text(GroupCallScheduledLeft::Negative::Show),
st::groupCallTopBarOpen,
RoundButtonTextToUpper);
st::groupCallTopBarOpen);
_open->setTextTransform(RoundButtonTextTransform::ToUpper);
setupRightButton(_open.get());
_open->widthValue(
) | rpl::on_next([=] {
@@ -494,7 +494,8 @@ 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, RoundButtonTextToUpper);
auto result = object_ptr<RoundButton>(parent, rpl::single(u""_q), *st);
result->setTextTransform(RoundButtonTextTransform::ToUpper);
struct Data {
TextWithEntities text;
@@ -660,7 +660,9 @@ Notification::Notification(
, _forwardedCount(forwardedCount)
, _fromScheduled(fromScheduled)
, _close(this, st::notifyClose)
, _reply(this, tr::lng_notification_reply(), st::defaultBoxButton, Ui::RoundButtonTextToUpper) {
, _reply(this, tr::lng_notification_reply(), st::defaultBoxButton) {
_reply->setTextTransform(Ui::RoundButtonTextTransform::ToUpper);
Lang::Updated(
) | rpl::on_next([=] {
refreshLang();