Improve mute button styles.

This commit is contained in:
John Preston 2020-08-13 18:45:40 +04:00
parent f1b6d1fdae
commit 8af40c22a4
3 changed files with 30 additions and 17 deletions

View file

@ -50,7 +50,7 @@ CallBodyLayout {
callBodyLayout: CallBodyLayout {
height: 284px;
photoTop: 21px;
photoSize: 180px;
photoSize: 160px;
nameTop: 221px;
statusTop: 254px;
}
@ -114,28 +114,36 @@ callHangup: CallButton {
}
callCancel: CallButton {
button: IconButton(callButton) {
icon: icon {{ "box_button_close", callCancelFg }};
icon: icon {{ "box_button_close", callIconFgActive }};
ripple: RippleAnimation(defaultRippleAnimation) {
color: callCancelRipple;
color: callIconActiveRipple;
}
}
bg: callCancelBg;
outerBg: callCancelBg;
bg: callIconBgActive;
outerBg: callIconBgActive;
label: callButtonLabel;
}
callMuteToggle: CallButton {
callMicrophoneMute: CallButton {
button: IconButton(callButton) {
icon: icon {{ "call_record_active", callIconFg }};
ripple: RippleAnimation(defaultRippleAnimation) {
color: callMuteRipple;
}
}
bg: callMuteRipple;
bg: callIconBg;
outerBg: callMuteRipple;
label: callButtonLabel;
}
callUnmuteIcon: icon {{ "call_record_muted", callIconFg }};
callCameraToggle: CallButton(callMuteToggle) {
callMicrophoneUnmute: CallButton(callMicrophoneMute) {
button: IconButton(callButton) {
icon: icon {{ "call_record_muted", callIconFgActive }};
ripple: RippleAnimation(defaultRippleAnimation) {
color: callIconActiveRipple;
}
}
bg: callIconBgActive;
}
callCameraMute: CallButton(callMicrophoneMute) {
button: IconButton(callButton) {
icon: icon {{ "call_camera_active", callIconFg }};
ripple: RippleAnimation(defaultRippleAnimation) {
@ -143,7 +151,14 @@ callCameraToggle: CallButton(callMuteToggle) {
}
}
}
callNoCameraIcon: icon {{ "call_camera_muted", callIconFg }};
callCameraUnmute: CallButton(callMicrophoneUnmute) {
button: IconButton(callButton) {
icon: icon {{ "call_camera_muted", callIconFgActive }};
ripple: RippleAnimation(defaultRippleAnimation) {
color: callIconActiveRipple;
}
}
}
callName: FlatLabel(defaultFlatLabel) {
minWidth: 260px;

View file

@ -276,8 +276,8 @@ Panel::Panel(not_null<Call*> call)
, _answerHangupRedial(widget(), st::callAnswer, &st::callHangup)
, _decline(widget(), object_ptr<Button>(widget(), st::callHangup))
, _cancel(widget(), object_ptr<Button>(widget(), st::callCancel))
, _camera(widget(), st::callCameraToggle)
, _mute(widget(), st::callMuteToggle)
, _camera(widget(), st::callCameraMute, &st::callCameraUnmute)
, _mute(widget(), st::callMicrophoneMute, &st::callMicrophoneUnmute)
, _name(widget(), st::callName)
, _status(widget(), st::callStatus) {
_decline->setDuration(st::callPanelDuration);
@ -483,14 +483,12 @@ void Panel::reinitWithCall(Call *call) {
_call->mutedValue(
) | rpl::start_with_next([=](bool mute) {
_mute->setIconOverride(mute ? &st::callUnmuteIcon : nullptr);
_mute->setProgress(mute ? 1. : 0.);
}, _callLifetime);
_call->videoOutgoing()->stateValue(
) | rpl::start_with_next([=](Webrtc::VideoState state) {
_camera->setIconOverride((state == Webrtc::VideoState::Active)
? nullptr
: &st::callNoCameraIcon);
_camera->setProgress((state == Webrtc::VideoState::Active) ? 0. : 1.);
}, _callLifetime);
_call->stateValue(

@ -1 +1 @@
Subproject commit 921686055c2b8b3a47a7f81840339a5a716b4edd
Subproject commit 50aa8497c290f23c496b62882921a6143e9d8321