mirror of https://github.com/procxx/kepka.git
Fix crash in audio player hiding.
This commit is contained in:
parent
b34099f49e
commit
bd8dee0972
|
@ -1744,7 +1744,7 @@ void MainWidget::createPlayer() {
|
|||
_player->shownValue()
|
||||
) | rpl::start_with_next(
|
||||
[this] { playerHeightUpdated(); },
|
||||
lifetime());
|
||||
_player->lifetime());
|
||||
_player->entity()->setCloseCallback([this] { closeBothPlayers(); });
|
||||
_playerVolume.create(this);
|
||||
_player->entity()->volumeWidgetCreated(_playerVolume);
|
||||
|
@ -1768,6 +1768,10 @@ void MainWidget::createPlayer() {
|
|||
}
|
||||
|
||||
void MainWidget::playerHeightUpdated() {
|
||||
if (!_player) {
|
||||
// Player could be already "destroyDelayed", but still handle events.
|
||||
return;
|
||||
}
|
||||
auto playerHeight = _player->contentHeight();
|
||||
if (playerHeight != _playerHeight) {
|
||||
_contentScrollAddToY += playerHeight - _playerHeight;
|
||||
|
|
|
@ -120,8 +120,9 @@ void SlideWrap<RpWidget>::animationStep() {
|
|||
}
|
||||
auto shouldBeHidden = !_toggled && !_animation.animating();
|
||||
if (shouldBeHidden != isHidden()) {
|
||||
const auto guard = make_weak(this);
|
||||
setVisible(!shouldBeHidden);
|
||||
if (shouldBeHidden) {
|
||||
if (shouldBeHidden && guard) {
|
||||
SendPendingMoveResizeEvents(this);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue