mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-02 07:25:46 +00:00
Improve phrases in share voice chat link box.
This commit is contained in:
@@ -173,6 +173,9 @@ ShareBox::ShareBox(QWidget*, Descriptor &&descriptor)
|
||||
tr::lng_photos_comment()),
|
||||
st::shareCommentPadding)
|
||||
, _bottomWidget(std::move(_descriptor.bottomWidget))
|
||||
, _copyLinkText(_descriptor.copyLinkText
|
||||
? std::move(_descriptor.copyLinkText)
|
||||
: tr::lng_share_copy_link())
|
||||
, _searchTimer([=] { searchByUsername(); }) {
|
||||
if (_bottomWidget) {
|
||||
_bottomWidget->setParent(this);
|
||||
@@ -452,7 +455,7 @@ void ShareBox::createButtons() {
|
||||
[=] { submitSilent(); },
|
||||
[=] { submitScheduled(); });
|
||||
} else if (_descriptor.copyCallback) {
|
||||
addButton(tr::lng_share_copy_link(), [=] { copyLink(); });
|
||||
addButton(_copyLinkText.value(), [=] { copyLink(); });
|
||||
}
|
||||
addButton(tr::lng_cancel(), [=] { closeBox(); });
|
||||
}
|
||||
|
@@ -75,6 +75,7 @@ public:
|
||||
Fn<void(not_null<Ui::InputField*>)> initSpellchecker;
|
||||
Fn<void(not_null<Ui::InputField*>)> initEditLink;
|
||||
object_ptr<Ui::RpWidget> bottomWidget = { nullptr };
|
||||
rpl::producer<QString> copyLinkText;
|
||||
const style::MultiSelect *stMultiSelect = nullptr;
|
||||
const style::InputField *stComment = nullptr;
|
||||
const style::PeerList *st = nullptr;
|
||||
@@ -129,6 +130,7 @@ private:
|
||||
QPointer<Inner> _inner;
|
||||
|
||||
bool _hasSelected = false;
|
||||
rpl::variable<QString> _copyLinkText;
|
||||
|
||||
base::Timer _searchTimer;
|
||||
QString _peopleQuery;
|
||||
|
@@ -106,13 +106,13 @@ object_ptr<ShareBox> ShareInviteLinkBox(
|
||||
nullptr,
|
||||
object_ptr<Ui::Checkbox>(
|
||||
nullptr,
|
||||
tr::lng_group_call_share_listener(tr::now),
|
||||
tr::lng_group_call_share_speaker(tr::now),
|
||||
true,
|
||||
st::groupCallCheckbox),
|
||||
st::groupCallShareMutedMargin);
|
||||
const auto listenerCheckbox = bottom ? bottom->entity() : nullptr;
|
||||
const auto speakerCheckbox = bottom ? bottom->entity() : nullptr;
|
||||
const auto currentLink = [=] {
|
||||
return (!listenerCheckbox || listenerCheckbox->checked())
|
||||
return (!speakerCheckbox || !speakerCheckbox->checked())
|
||||
? linkListener
|
||||
: linkSpeaker;
|
||||
};
|
||||
@@ -192,6 +192,12 @@ object_ptr<ShareBox> ShareInviteLinkBox(
|
||||
.submitCallback = std::move(submitCallback),
|
||||
.filterCallback = std::move(filterCallback),
|
||||
.bottomWidget = std::move(bottom),
|
||||
.copyLinkText = rpl::conditional(
|
||||
(speakerCheckbox
|
||||
? speakerCheckbox->checkedValue()
|
||||
: rpl::single(false)),
|
||||
tr::lng_group_call_copy_speaker_link(),
|
||||
tr::lng_group_call_copy_listener_link()),
|
||||
.stMultiSelect = &st::groupCallMultiSelect,
|
||||
.stComment = &st::groupCallShareBoxComment,
|
||||
.st = &st::groupCallShareBoxList });
|
||||
|
Reference in New Issue
Block a user