mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Show information about absent RTMP stream.
This commit is contained in:
@@ -795,6 +795,7 @@ void Panel::setupMembers() {
|
||||
|
||||
_members->show();
|
||||
|
||||
setupEmptyRtmp();
|
||||
refreshControlsBackground();
|
||||
raiseControls();
|
||||
|
||||
@@ -1596,6 +1597,38 @@ void Panel::updateButtonsStyles() {
|
||||
: st::groupCallHangup);
|
||||
}
|
||||
|
||||
void Panel::setupEmptyRtmp() {
|
||||
_call->emptyRtmpValue(
|
||||
) | rpl::start_with_next([=](bool empty) {
|
||||
if (!empty) {
|
||||
_emptyRtmp.destroy();
|
||||
return;
|
||||
} else if (_emptyRtmp) {
|
||||
return;
|
||||
}
|
||||
auto text = _call->rtmpUrl().isEmpty()
|
||||
? tr::lng_group_call_no_stream(
|
||||
lt_group,
|
||||
rpl::single(_peer->name))
|
||||
: tr::lng_group_call_no_stream_admin();
|
||||
_emptyRtmp.create(
|
||||
widget(),
|
||||
std::move(text),
|
||||
st::groupCallVideoLimitLabel);
|
||||
widget()->sizeValue(
|
||||
) | rpl::start_with_next([=](QSize size) {
|
||||
const auto width = std::min(
|
||||
size.width() - st::groupCallWidth / 10,
|
||||
st::groupCallWidth);
|
||||
_emptyRtmp->resizeToWidth(width);
|
||||
_emptyRtmp->move(
|
||||
(size.width() - _emptyRtmp->width()) / 2,
|
||||
(size.height() - _emptyRtmp->height()) / 3);
|
||||
}, _emptyRtmp->lifetime());
|
||||
}, lifetime());
|
||||
|
||||
}
|
||||
|
||||
void Panel::refreshControlsBackground() {
|
||||
if (!_members) {
|
||||
return;
|
||||
|
@@ -161,6 +161,7 @@ private:
|
||||
std::optional<bool> overrideWideMode = std::nullopt);
|
||||
void refreshTopButton();
|
||||
void createPinOnTop();
|
||||
void setupEmptyRtmp();
|
||||
void toggleWideControls(bool shown);
|
||||
void updateWideControlsVisibility();
|
||||
[[nodiscard]] bool videoButtonInNarrowMode() const;
|
||||
@@ -225,6 +226,7 @@ private:
|
||||
object_ptr<Ui::RpWidget> _countdown = { nullptr };
|
||||
std::shared_ptr<Ui::GroupCallScheduledLeft> _countdownData;
|
||||
object_ptr<Ui::FlatLabel> _startsWhen = { nullptr };
|
||||
object_ptr<Ui::FlatLabel> _emptyRtmp = { nullptr };
|
||||
ChooseJoinAsProcess _joinAsProcess;
|
||||
std::optional<QRect> _lastSmallGeometry;
|
||||
std::optional<QRect> _lastLargeGeometry;
|
||||
|
Reference in New Issue
Block a user