mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Removed ability to select hidden stream key.
This commit is contained in:
parent
fc5ed46b40
commit
7cea4efac1
2 changed files with 18 additions and 5 deletions
|
@ -31,6 +31,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
namespace Calls::Group {
|
namespace Calls::Group {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
constexpr auto kPasswordCharAmount = 28;
|
||||||
|
|
||||||
void StartWithBox(
|
void StartWithBox(
|
||||||
not_null<Ui::GenericBox*> box,
|
not_null<Ui::GenericBox*> box,
|
||||||
Fn<void()> done,
|
Fn<void()> done,
|
||||||
|
@ -123,13 +125,16 @@ void StartWithBox(
|
||||||
state->hidden.value(),
|
state->hidden.value(),
|
||||||
state->key.value()
|
state->key.value()
|
||||||
) | rpl::map([passChar](bool hidden, const QString &key) {
|
) | rpl::map([passChar](bool hidden, const QString &key) {
|
||||||
return hidden
|
return key.isEmpty()
|
||||||
? QString().fill(passChar, int(key.size()))
|
? QString()
|
||||||
|
: hidden
|
||||||
|
? QString().fill(passChar, kPasswordCharAmount)
|
||||||
: key;
|
: key;
|
||||||
});
|
});
|
||||||
const auto streamKeyLabel = addLabel(
|
const auto streamKeyLabel = addLabel(
|
||||||
std::move(keyLabelContent),
|
std::move(keyLabelContent),
|
||||||
st::boxLabel);
|
st::boxLabel);
|
||||||
|
streamKeyLabel->setSelectable(false);
|
||||||
const auto streamKeyButton = Ui::CreateChild<Ui::IconButton>(
|
const auto streamKeyButton = Ui::CreateChild<Ui::IconButton>(
|
||||||
box.get(),
|
box.get(),
|
||||||
st::groupCallRtmpShowButton);
|
st::groupCallRtmpShowButton);
|
||||||
|
@ -142,13 +147,21 @@ void StartWithBox(
|
||||||
streamKeyButton->raise();
|
streamKeyButton->raise();
|
||||||
}, box->lifetime());
|
}, box->lifetime());
|
||||||
streamKeyButton->addClickHandler([=] {
|
streamKeyButton->addClickHandler([=] {
|
||||||
|
const auto toggle = [=] {
|
||||||
|
const auto newValue = !state->hidden.current();
|
||||||
|
state->hidden = newValue;
|
||||||
|
streamKeyLabel->setSelectable(!newValue);
|
||||||
|
streamKeyLabel->setAttribute(
|
||||||
|
Qt::WA_TransparentForMouseEvents,
|
||||||
|
newValue);
|
||||||
|
};
|
||||||
if (!state->warned && state->hidden.current()) {
|
if (!state->warned && state->hidden.current()) {
|
||||||
showBox(Ui::MakeConfirmBox({
|
showBox(Ui::MakeConfirmBox({
|
||||||
.text = tr::lng_group_call_rtmp_key_warning(
|
.text = tr::lng_group_call_rtmp_key_warning(
|
||||||
Ui::Text::RichLangValue),
|
Ui::Text::RichLangValue),
|
||||||
.confirmed = [=](Fn<void()> &&close) {
|
.confirmed = [=](Fn<void()> &&close) {
|
||||||
state->warned = true;
|
state->warned = true;
|
||||||
state->hidden = !state->hidden.current();
|
toggle();
|
||||||
close();
|
close();
|
||||||
},
|
},
|
||||||
.confirmText = tr::lng_from_request_understand(),
|
.confirmText = tr::lng_from_request_understand(),
|
||||||
|
@ -156,7 +169,7 @@ void StartWithBox(
|
||||||
.confirmStyle = &st::attentionBoxButton,
|
.confirmStyle = &st::attentionBoxButton,
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
state->hidden = !state->hidden.current();
|
toggle();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 6392af756fe51c72b6ffd8be4f429f449e1e1d1e
|
Subproject commit 73ec29fa06e3cd353294b2282a00b66528a65ff3
|
Loading…
Add table
Reference in a new issue