mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Playlist appearance added to the new media player.
Also itemRemoved() now is fired as a global observable.
This commit is contained in:
@@ -103,18 +103,8 @@ TitleWidget::TitleWidget(QWidget *parent) : TWidget(parent)
|
||||
|
||||
subscribe(Adaptive::Changed(), [this]() { updateAdaptiveLayout(); });
|
||||
if (Media::Player::exists()) {
|
||||
subscribe(Media::Player::instance()->createdNotifier(), [this](const Media::Player::PanelEvent &e) {
|
||||
if (!_player) {
|
||||
_player.create(this);
|
||||
updateControlsVisibility();
|
||||
}
|
||||
_player->installEventFilter(e.panel);
|
||||
});
|
||||
subscribe(Media::Player::instance()->destroyedNotifier(), [this](const Media::Player::PanelEvent &e) {
|
||||
if (_player) {
|
||||
_player.destroyDelayed();
|
||||
updateControlsVisibility();
|
||||
}
|
||||
subscribe(Media::Player::instance()->usePanelPlayer(), [this](bool usePanel) {
|
||||
updatePlayerButton(usePanel);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -179,6 +169,15 @@ void TitleWidget::onAbout() {
|
||||
Ui::showLayer(new AboutBox());
|
||||
}
|
||||
|
||||
void TitleWidget::updatePlayerButton(bool usePanel) {
|
||||
if (usePanel && !_player) {
|
||||
_player.create(this);
|
||||
} else if (!usePanel && _player) {
|
||||
_player.destroyDelayed();
|
||||
}
|
||||
updateControlsVisibility();
|
||||
}
|
||||
|
||||
void TitleWidget::updateControlsPosition() {
|
||||
QPoint p(width() - ((cPlatform() == dbipWindows && lastMaximized) ? 0 : st::sysBtnDelta), 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user