Replaced link button for switch of business hours with small round one.

This commit is contained in:
23rd 2025-02-04 21:54:40 +03:00 committed by John Preston
parent 049ebf9027
commit e4af1570cb

View file

@ -534,10 +534,7 @@ base::options::toggle ShowPeerIdBelowAbout({
tr::lng_info_hours_label(), tr::lng_info_hours_label(),
st::infoLabel); st::infoLabel);
label->setAttribute(Qt::WA_TransparentForMouseEvents); label->setAttribute(Qt::WA_TransparentForMouseEvents);
const auto link = Ui::CreateChild<Ui::LinkButton>( auto linkText = rpl::combine(
labelWrap,
QString());
rpl::combine(
state->nonTrivial.value(), state->nonTrivial.value(),
state->hours.value(), state->hours.value(),
state->mine.value(), state->mine.value(),
@ -552,10 +549,12 @@ base::options::toggle ShowPeerIdBelowAbout({
: my : my
? tr::lng_info_hours_my_time() ? tr::lng_info_hours_my_time()
: tr::lng_info_hours_local_time(); : tr::lng_info_hours_local_time();
}) | rpl::flatten_latest( }) | rpl::flatten_latest();
) | rpl::start_with_next([=](const QString &text) { const auto link = Ui::CreateChild<Ui::RoundButton>(
link->setText(text); labelWrap,
}, link->lifetime()); std::move(linkText),
st::defaultTableSmallButton);
link->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
link->setClickedCallback([=] { link->setClickedCallback([=] {
state->myTimezone = !state->myTimezone.current(); state->myTimezone = !state->myTimezone.current();
state->expanded = true; state->expanded = true;