Fix cal buttons positioning.

This commit is contained in:
John Preston 2025-03-30 15:25:47 +05:00
parent d052eac019
commit c846eeed9d

View file

@ -1233,8 +1233,11 @@ void Panel::updateOutgoingVideoBubbleGeometry() {
}
void Panel::updateHangupGeometry() {
const auto isBusy = (_call
&& _call->state() == State::Busy);
const auto isWaitingUser = (_call
&& _call->state() == State::WaitingUserConfirmation);
const auto incomingWaiting = _call && _call->isIncomingWaiting();
const auto hangupProgress = isWaitingUser
? 0.
: _hangupShownProgress.value(_hangupShown ? 1. : 0.);
@ -1243,7 +1246,8 @@ void Panel::updateHangupGeometry() {
// Screencast - Camera - Cancel/Decline - Answer/Hangup/Redial - Mute.
const auto buttonWidth = st::callCancel.button.width;
const auto cancelWidth = buttonWidth * (1. - hangupProgress);
const auto cancelLeft = (widget()->width() - buttonWidth) / 2;
const auto cancelLeft = (widget()->width() - buttonWidth) / 2
- ((isBusy || incomingWaiting) ? buttonWidth : 0);
_cancel->moveToLeft(cancelLeft, _buttonsTop);
_decline->moveToLeft(cancelLeft, _buttonsTop);