Fix player controls with animations disabled.

This commit is contained in:
John Preston 2021-11-29 10:25:30 +04:00
parent 453ce1bff9
commit 07dfe88d62
3 changed files with 6 additions and 5 deletions

View File

@ -291,7 +291,7 @@ mediaPlayerFileLayout: OverviewFileLayout(overviewFileLayout) {
mediaPlayerFloatSize: 128px;
mediaPlayerFloatMargin: 12px;
mediaPlayerMenuPosition: point(-2px, 0px);
mediaPlayerMenuPosition: point(-2px, -2px);
mediaPlayerOrderMenu: Menu(defaultMenu) {
itemIconPosition: point(13px, 8px);
itemPadding: margins(49px, 9px, 17px, 11px);

View File

@ -528,17 +528,18 @@ Widget::Widget(
hidePlaylistOn(_playPause);
hidePlaylistOn(_close);
hidePlaylistOn(_rightControls);
setType(AudioMsgId::Type::Song);
}
void Widget::hidePlaylistOn(const object_ptr<Ui::IconButton> &button) {
button->events(
void Widget::hidePlaylistOn(not_null<Ui::RpWidget*> widget) {
widget->events(
) | rpl::filter([=](not_null<QEvent*> e) {
return (e->type() == QEvent::Enter);
}) | rpl::start_with_next([=] {
updateOverLabelsState(false);
}, button->lifetime());
}, widget->lifetime());
}
void Widget::setupRightControls() {

View File

@ -84,7 +84,7 @@ private:
[[nodiscard]] int getTimeRight() const;
void updateOverLabelsState(QPoint pos);
void updateOverLabelsState(bool over);
void hidePlaylistOn(const object_ptr<Ui::IconButton> &button);
void hidePlaylistOn(not_null<Ui::RpWidget*> widget);
void updatePlayPrevNextPositions();
void updateLabelsGeometry();