Support box->setTitle(v::text::data, context).

This commit is contained in:
John Preston
2026-03-27 12:04:19 +07:00
parent c64f175b19
commit 353c95adae
10 changed files with 12 additions and 14 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ rpl::producer<TextWithEntities> Text3() {
} // namespace
void AboutBox(not_null<Ui::GenericBox*> box) {
box->setTitle(rpl::single(u"Telegram Desktop"_q));
box->setTitle(u"Telegram Desktop"_q);
auto layout = box->verticalLayout();
@@ -105,11 +105,9 @@ void ShowReportMessageBox(
}
if (!result.options.empty() || result.commentOption) {
show->show(Box([=](not_null<Ui::GenericBox*> box) {
box->setTitle(
rpl::single(
result.title.isEmpty()
? reportInput.optionText
: result.title));
box->setTitle(result.title.isEmpty()
? reportInput.optionText
: result.title);
for (const auto &option : result.options) {
const auto button = Ui::AddReportOptionButton(
+1 -1
View File
@@ -149,7 +149,7 @@ DebugInfoBox::DebugInfoBox(QWidget*, base::weak_ptr<Call> call)
}
void DebugInfoBox::prepare() {
setTitle(rpl::single(u"Call Debug"_q));
setTitle(u"Call Debug"_q);
addButton(tr::lng_close(), [this] { closeBox(); });
_text = setInnerWidget(
@@ -372,7 +372,7 @@ void EditWebPageOptions(
Data::WebPageDraft draft,
Fn<void(Data::WebPageDraft)> done) {
show->show(Box([=](not_null<Ui::GenericBox*> box) {
box->setTitle(rpl::single(u"Link Preview"_q));
box->setTitle(u"Link Preview"_q);
struct State {
rpl::variable<Data::WebPageDraft> result;
+1 -1
View File
@@ -318,7 +318,7 @@ void ShowReportSponsoredBox(
}
if (!result.options.empty()) {
show->show(Box([=](not_null<Ui::GenericBox*> box) {
box->setTitle(rpl::single(result.title));
box->setTitle(result.title);
for (const auto &option : result.options) {
const auto button = Ui::AddReportOptionButton(
@@ -495,7 +495,7 @@ ConfirmContactBox::ConfirmContactBox(
}
void ConfirmContactBox::prepare() {
setTitle(rpl::single(u"Confirmation"_q)); // #TODO hard_lang
setTitle(u"Confirmation"_q); // #TODO hard_lang
auto maxWidth = 0;
if (_comment) {
@@ -102,7 +102,7 @@ EditInfoBox::EditInfoBox(
}
void EditInfoBox::prepare() {
setTitle(rpl::single(u"Edit support information"_q)); // #TODO hard_lang
setTitle(u"Edit support information"_q); // #TODO hard_lang
const auto save = [=] {
const auto done = crl::guard(this, [=](bool success) {
+1 -1
View File
@@ -485,7 +485,7 @@ void BoostBox(
+ QMargins(0, st::boostTextSkip, 0, st::boostBottomSkip)));
const auto current = state->data.current();
box->setTitle(rpl::single(QString()));
box->setTitle(QString());
AddFeaturesList(
box->verticalLayout(),
data.features,
@@ -346,7 +346,7 @@ void EditorBlock::activateRow(const Row &row) {
});
box->addButton(tr::lng_settings_save(), save);
box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
box->setTitle(rpl::single(name));
box->setTitle(name);
box->setWidth(editor->width());
_context->colorEditor.box = box;