Show information about ForceMuted state.

This commit is contained in:
John Preston 2020-12-16 15:29:15 +04:00
parent 29e7ea9b36
commit a85be4ccd0
4 changed files with 15 additions and 12 deletions

View File

@ -343,13 +343,15 @@ void GroupPanel::endCall() {
void GroupPanel::initControls() {
_mute->clicks(
) | rpl::filter([=](Qt::MouseButton button) {
return (button == Qt::LeftButton)
&& _call
&& (_call->muted() != MuteState::ForceMuted);
return (button == Qt::LeftButton) && (_call != nullptr);
}) | rpl::start_with_next([=] {
_call->setMuted((_call->muted() == MuteState::Muted)
? MuteState::Active
: MuteState::Muted);
if (_call->muted() == MuteState::ForceMuted) {
_mute->shake();
} else {
_call->setMuted((_call->muted() == MuteState::Muted)
? MuteState::Active
: MuteState::Muted);
}
}, _mute->lifetime());
_hangup->setClickedCallback([=] { endCall(); });

View File

@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/layers/generic_box.h"
#include "ui/wrap/padding_wrap.h"
#include "ui/text/format_values.h"
#include "ui/toast/toast.h"
#include "lang/lang_keys.h"
#include "core/application.h"
#include "calls/calls_call.h"
@ -239,7 +240,9 @@ void TopBar::initControls() {
if (const auto call = _call.get()) {
call->setMuted(!call->muted());
} else if (const auto group = _groupCall.get()) {
if (group->muted() != MuteState::ForceMuted) {
if (group->muted() == MuteState::ForceMuted) {
Ui::Toast::Show(tr::lng_group_call_force_muted(tr::now));
} else {
group->setMuted((group->muted() == MuteState::Muted)
? MuteState::Active
: MuteState::Muted);
@ -268,9 +271,7 @@ void TopBar::initControls() {
if (isForceMuted) {
_mute->clearState();
}
_mute->setAttribute(
Qt::WA_TransparentForMouseEvents,
isForceMuted);
_mute->setPointerCursor(!isForceMuted);
const auto to = 1.;
const auto from = _switchStateAnimation.animating()

@ -1 +1 @@
Subproject commit 905ed863c19bc39b04b3b1c070b39195fedfef1e
Subproject commit a21d24aeb755f2c975eced1dcb101b6520614e15

@ -1 +1 @@
Subproject commit 300c5a9c6638fd5ad797357246c7ef08a2587ab8
Subproject commit 3bd98ac5640523d2ccd241c2c0af49aba9494066