2016-10-12 19:34:25 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2016-10-12 19:34:25 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2016-10-12 19:34:25 +00:00
|
|
|
*/
|
|
|
|
#include "media/player/media_player_panel.h"
|
|
|
|
|
|
|
|
#include "media/player/media_player_instance.h"
|
2017-12-09 15:13:06 +00:00
|
|
|
#include "info/media/info_media_list_widget.h"
|
2018-01-13 12:45:11 +00:00
|
|
|
#include "history/history.h"
|
|
|
|
#include "history/history_item.h"
|
2019-04-25 12:45:15 +00:00
|
|
|
#include "data/data_session.h"
|
2017-12-10 10:26:58 +00:00
|
|
|
#include "data/data_document.h"
|
2018-01-14 16:02:25 +00:00
|
|
|
#include "data/data_media_types.h"
|
2019-01-04 11:09:48 +00:00
|
|
|
#include "data/data_channel.h"
|
|
|
|
#include "data/data_chat.h"
|
2016-10-13 15:04:40 +00:00
|
|
|
#include "ui/widgets/shadow.h"
|
2016-11-16 10:44:06 +00:00
|
|
|
#include "ui/widgets/scroll_area.h"
|
2019-09-13 12:22:54 +00:00
|
|
|
#include "ui/ui_utility.h"
|
2020-10-13 15:11:53 +00:00
|
|
|
#include "ui/cached_round_corners.h"
|
2016-10-12 19:34:25 +00:00
|
|
|
#include "mainwindow.h"
|
2019-07-24 11:45:24 +00:00
|
|
|
#include "main/main_session.h"
|
2017-12-09 15:13:06 +00:00
|
|
|
#include "styles/style_overview.h"
|
|
|
|
#include "styles/style_widgets.h"
|
|
|
|
#include "styles/style_media_player.h"
|
|
|
|
#include "styles/style_info.h"
|
2016-10-12 19:34:25 +00:00
|
|
|
|
|
|
|
namespace Media {
|
|
|
|
namespace Player {
|
2017-12-09 15:13:06 +00:00
|
|
|
namespace {
|
2016-10-12 19:34:25 +00:00
|
|
|
|
2017-12-09 15:13:06 +00:00
|
|
|
using ListWidget = Info::Media::ListWidget;
|
|
|
|
|
|
|
|
constexpr auto kPlaylistIdsLimit = 32;
|
2019-02-19 06:57:53 +00:00
|
|
|
constexpr auto kDelayedHideTimeout = crl::time(3000);
|
2016-10-12 19:34:25 +00:00
|
|
|
|
2017-12-09 15:13:06 +00:00
|
|
|
} // namespace
|
2016-10-12 19:34:25 +00:00
|
|
|
|
2017-12-09 15:13:06 +00:00
|
|
|
Panel::Panel(
|
|
|
|
QWidget *parent,
|
2019-06-06 10:21:40 +00:00
|
|
|
not_null<Window::SessionController*> window)
|
2017-12-09 15:13:06 +00:00
|
|
|
: RpWidget(parent)
|
|
|
|
, AbstractController(window)
|
2020-06-25 11:12:50 +00:00
|
|
|
, _showTimer([=] { startShow(); })
|
|
|
|
, _hideTimer([=] { startHideChecked(); })
|
2017-12-09 15:13:06 +00:00
|
|
|
, _scroll(this, st::mediaPlayerScroll) {
|
2016-10-12 19:34:25 +00:00
|
|
|
hide();
|
2016-10-14 17:10:15 +00:00
|
|
|
updateSize();
|
2016-10-12 19:34:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Panel::overlaps(const QRect &globalRect) {
|
|
|
|
if (isHidden() || _a_appearance.animating()) return false;
|
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
auto marginLeft = rtl() ? contentRight() : contentLeft();
|
|
|
|
auto marginRight = rtl() ? contentLeft() : contentRight();
|
|
|
|
return rect().marginsRemoved(QMargins(marginLeft, contentTop(), marginRight, contentBottom())).contains(QRect(mapFromGlobal(globalRect.topLeft()), globalRect.size()));
|
2016-10-12 19:34:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Panel::resizeEvent(QResizeEvent *e) {
|
2016-10-14 17:10:15 +00:00
|
|
|
updateControlsGeometry();
|
|
|
|
}
|
|
|
|
|
2017-12-09 15:13:06 +00:00
|
|
|
void Panel::listHeightUpdated(int newHeight) {
|
2019-02-28 21:03:25 +00:00
|
|
|
if (newHeight > emptyInnerHeight()) {
|
2017-12-09 15:13:06 +00:00
|
|
|
updateSize();
|
|
|
|
} else {
|
|
|
|
_hideTimer.callOnce(0);
|
2016-10-14 18:44:15 +00:00
|
|
|
}
|
2016-10-14 17:10:15 +00:00
|
|
|
}
|
2016-10-13 15:04:40 +00:00
|
|
|
|
2017-12-09 15:13:06 +00:00
|
|
|
bool Panel::contentTooSmall() const {
|
|
|
|
const auto innerHeight = _scroll->widget()
|
|
|
|
? _scroll->widget()->height()
|
|
|
|
: emptyInnerHeight();
|
2019-02-28 21:03:25 +00:00
|
|
|
return (innerHeight <= emptyInnerHeight());
|
2017-12-09 15:13:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int Panel::emptyInnerHeight() const {
|
|
|
|
return st::infoMediaMargin.top()
|
|
|
|
+ st::overviewFileLayout.songPadding.top()
|
|
|
|
+ st::overviewFileLayout.songThumbSize
|
|
|
|
+ st::overviewFileLayout.songPadding.bottom()
|
|
|
|
+ st::infoMediaMargin.bottom();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Panel::preventAutoHide() const {
|
|
|
|
if (const auto list = static_cast<ListWidget*>(_scroll->widget())) {
|
|
|
|
return list->preventAutoHide();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
void Panel::updateControlsGeometry() {
|
2020-10-31 12:14:16 +00:00
|
|
|
const auto scrollTop = contentTop();
|
|
|
|
const auto width = contentWidth();
|
|
|
|
const auto scrollHeight = qMax(
|
|
|
|
height() - scrollTop - contentBottom() - scrollMarginBottom(),
|
|
|
|
0);
|
2016-10-13 15:04:40 +00:00
|
|
|
if (scrollHeight > 0) {
|
2016-10-14 17:10:15 +00:00
|
|
|
_scroll->setGeometryToRight(contentRight(), scrollTop, width, scrollHeight);
|
2016-10-13 15:04:40 +00:00
|
|
|
}
|
2020-10-31 12:14:16 +00:00
|
|
|
if (const auto widget = static_cast<TWidget*>(_scroll->widget())) {
|
2016-10-13 15:04:40 +00:00
|
|
|
widget->resizeToWidth(width);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
int Panel::bestPositionFor(int left) const {
|
|
|
|
left -= contentLeft();
|
|
|
|
left -= st::mediaPlayerFileLayout.songPadding.left();
|
|
|
|
left -= st::mediaPlayerFileLayout.songThumbSize / 2;
|
|
|
|
return left;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Panel::scrollPlaylistToCurrentTrack() {
|
2017-12-09 15:13:06 +00:00
|
|
|
if (const auto list = static_cast<ListWidget*>(_scroll->widget())) {
|
|
|
|
const auto rect = list->getCurrentSongGeometry();
|
|
|
|
_scroll->scrollToY(rect.y() - st::infoMediaMargin.top());
|
2016-10-13 15:04:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Panel::updateSize() {
|
2016-10-14 17:10:15 +00:00
|
|
|
auto width = contentLeft() + st::mediaPlayerPanelWidth + contentRight();
|
|
|
|
auto height = contentTop();
|
2016-10-13 15:04:40 +00:00
|
|
|
auto listHeight = 0;
|
2016-10-14 18:44:15 +00:00
|
|
|
if (auto widget = _scroll->widget()) {
|
2016-10-13 15:04:40 +00:00
|
|
|
listHeight = widget->height();
|
|
|
|
}
|
|
|
|
auto scrollVisible = (listHeight > 0);
|
|
|
|
auto scrollHeight = scrollVisible ? (qMin(listHeight, st::mediaPlayerListHeightMax) + st::mediaPlayerListMarginBottom) : 0;
|
2016-10-14 17:10:15 +00:00
|
|
|
height += scrollHeight + contentBottom();
|
2016-10-13 15:04:40 +00:00
|
|
|
resize(width, height);
|
|
|
|
_scroll->setVisible(scrollVisible);
|
2016-10-12 19:34:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Panel::paintEvent(QPaintEvent *e) {
|
|
|
|
Painter p(this);
|
|
|
|
|
|
|
|
if (!_cache.isNull()) {
|
2019-04-02 09:13:30 +00:00
|
|
|
bool animating = _a_appearance.animating();
|
2016-10-12 19:34:25 +00:00
|
|
|
if (animating) {
|
2019-04-02 09:13:30 +00:00
|
|
|
p.setOpacity(_a_appearance.value(_hiding ? 0. : 1.));
|
2016-10-13 15:04:40 +00:00
|
|
|
} else if (_hiding || isHidden()) {
|
2016-10-26 16:43:13 +00:00
|
|
|
hideFinished();
|
2016-10-12 19:34:25 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
p.drawPixmap(0, 0, _cache);
|
|
|
|
if (!animating) {
|
|
|
|
showChildren();
|
|
|
|
_cache = QPixmap();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// draw shadow
|
2016-10-14 17:10:15 +00:00
|
|
|
auto shadowedRect = myrtlrect(contentLeft(), contentTop(), contentWidth(), contentHeight());
|
2019-02-28 21:03:25 +00:00
|
|
|
auto shadowedSides = (rtl() ? RectPart::Right : RectPart::Left)
|
|
|
|
| RectPart::Bottom
|
|
|
|
| (rtl() ? RectPart::Left : RectPart::Right)
|
|
|
|
| RectPart::Top;
|
2016-12-13 17:07:56 +00:00
|
|
|
Ui::Shadow::paint(p, shadowedRect, width(), st::defaultRoundShadow, shadowedSides);
|
2017-05-24 12:20:50 +00:00
|
|
|
auto parts = RectPart::Full;
|
2020-10-13 15:11:53 +00:00
|
|
|
Ui::FillRoundRect(p, shadowedRect, st::menuBg, Ui::MenuCorners, nullptr, parts);
|
2016-10-12 19:34:25 +00:00
|
|
|
}
|
|
|
|
|
2017-02-11 11:24:37 +00:00
|
|
|
void Panel::enterEventHook(QEvent *e) {
|
2017-12-09 15:13:06 +00:00
|
|
|
if (_ignoringEnterEvents || contentTooSmall()) return;
|
2016-10-14 17:10:15 +00:00
|
|
|
|
2017-12-09 15:13:06 +00:00
|
|
|
_hideTimer.cancel();
|
2019-04-02 09:13:30 +00:00
|
|
|
if (_a_appearance.animating()) {
|
2017-12-09 15:13:06 +00:00
|
|
|
startShow();
|
2016-10-12 19:34:25 +00:00
|
|
|
} else {
|
2017-12-09 15:13:06 +00:00
|
|
|
_showTimer.callOnce(0);
|
2016-10-12 19:34:25 +00:00
|
|
|
}
|
2019-04-05 10:13:54 +00:00
|
|
|
return RpWidget::enterEventHook(e);
|
2016-10-12 19:34:25 +00:00
|
|
|
}
|
|
|
|
|
2017-02-11 11:24:37 +00:00
|
|
|
void Panel::leaveEventHook(QEvent *e) {
|
2017-12-09 15:13:06 +00:00
|
|
|
if (preventAutoHide()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_showTimer.cancel();
|
2019-04-02 09:13:30 +00:00
|
|
|
if (_a_appearance.animating()) {
|
2017-12-09 15:13:06 +00:00
|
|
|
startHide();
|
2016-10-12 19:34:25 +00:00
|
|
|
} else {
|
2017-12-09 15:13:06 +00:00
|
|
|
_hideTimer.callOnce(300);
|
2016-10-12 19:34:25 +00:00
|
|
|
}
|
2019-04-05 10:13:54 +00:00
|
|
|
return RpWidget::leaveEventHook(e);
|
2016-10-12 19:34:25 +00:00
|
|
|
}
|
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
void Panel::showFromOther() {
|
2017-12-09 15:13:06 +00:00
|
|
|
_hideTimer.cancel();
|
2019-04-02 09:13:30 +00:00
|
|
|
if (_a_appearance.animating()) {
|
2017-12-09 15:13:06 +00:00
|
|
|
startShow();
|
2016-10-12 19:34:25 +00:00
|
|
|
} else {
|
2017-12-09 15:13:06 +00:00
|
|
|
_showTimer.callOnce(300);
|
2016-10-12 19:34:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
void Panel::hideFromOther() {
|
2017-12-09 15:13:06 +00:00
|
|
|
_showTimer.cancel();
|
2019-04-02 09:13:30 +00:00
|
|
|
if (_a_appearance.animating()) {
|
2017-12-09 15:13:06 +00:00
|
|
|
startHide();
|
2016-10-12 19:34:25 +00:00
|
|
|
} else {
|
2017-12-09 15:13:06 +00:00
|
|
|
_hideTimer.callOnce(0);
|
2016-10-12 19:34:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
void Panel::ensureCreated() {
|
|
|
|
if (_scroll->widget()) return;
|
|
|
|
|
2017-12-09 15:13:06 +00:00
|
|
|
_refreshListLifetime = instance()->playlistChanges(
|
|
|
|
AudioMsgId::Type::Song
|
2020-06-25 11:12:50 +00:00
|
|
|
) | rpl::start_with_next([=] {
|
2017-12-09 15:13:06 +00:00
|
|
|
refreshList();
|
|
|
|
});
|
|
|
|
refreshList();
|
2016-10-14 17:10:15 +00:00
|
|
|
|
2019-04-05 10:13:54 +00:00
|
|
|
macWindowDeactivateEvents(
|
|
|
|
) | rpl::filter([=] {
|
|
|
|
return !isHidden();
|
|
|
|
}) | rpl::start_with_next([=] {
|
|
|
|
leaveEvent(nullptr);
|
|
|
|
}, _refreshListLifetime);
|
2016-10-14 17:10:15 +00:00
|
|
|
|
|
|
|
_ignoringEnterEvents = false;
|
2016-10-12 19:34:25 +00:00
|
|
|
}
|
|
|
|
|
2017-12-09 15:13:06 +00:00
|
|
|
void Panel::refreshList() {
|
|
|
|
const auto current = instance()->current(AudioMsgId::Type::Song);
|
|
|
|
const auto contextId = current.contextId();
|
|
|
|
const auto peer = [&]() -> PeerData* {
|
2020-06-25 11:12:50 +00:00
|
|
|
if (const auto document = current.audio()) {
|
|
|
|
if (&document->session() != &session()) {
|
|
|
|
// Different account is playing music.
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
}
|
2019-08-06 16:40:08 +00:00
|
|
|
const auto item = contextId
|
|
|
|
? session().data().message(contextId)
|
|
|
|
: nullptr;
|
2018-01-14 16:02:25 +00:00
|
|
|
const auto media = item ? item->media() : nullptr;
|
|
|
|
const auto document = media ? media->document() : nullptr;
|
2020-01-28 13:46:55 +00:00
|
|
|
if (!document
|
|
|
|
|| !document->isSharedMediaMusic()
|
2021-07-01 12:00:09 +00:00
|
|
|
|| (!IsServerMsgId(item->id) && !item->isScheduled())) {
|
2017-12-10 10:26:58 +00:00
|
|
|
return nullptr;
|
2017-12-09 15:13:06 +00:00
|
|
|
}
|
2017-12-10 10:26:58 +00:00
|
|
|
const auto result = item->history()->peer;
|
|
|
|
if (const auto migrated = result->migrateTo()) {
|
|
|
|
return migrated;
|
|
|
|
}
|
|
|
|
return result;
|
2017-12-09 15:13:06 +00:00
|
|
|
}();
|
|
|
|
const auto migrated = peer ? peer->migrateFrom() : nullptr;
|
|
|
|
if (_listPeer != peer || _listMigratedPeer != migrated) {
|
|
|
|
_scroll->takeWidget<QWidget>().destroy();
|
|
|
|
_listPeer = _listMigratedPeer = nullptr;
|
|
|
|
}
|
|
|
|
if (peer && !_listPeer) {
|
|
|
|
_listPeer = peer;
|
|
|
|
_listMigratedPeer = migrated;
|
|
|
|
auto list = object_ptr<ListWidget>(this, infoController());
|
|
|
|
|
|
|
|
const auto weak = _scroll->setOwnedWidget(std::move(list));
|
|
|
|
|
|
|
|
updateSize();
|
|
|
|
updateControlsGeometry();
|
|
|
|
|
|
|
|
weak->checkForHide(
|
|
|
|
) | rpl::start_with_next([this] {
|
|
|
|
if (!rect().contains(mapFromGlobal(QCursor::pos()))) {
|
|
|
|
_hideTimer.callOnce(kDelayedHideTimeout);
|
|
|
|
}
|
|
|
|
}, weak->lifetime());
|
|
|
|
|
|
|
|
weak->heightValue(
|
|
|
|
) | rpl::start_with_next([this](int newHeight) {
|
|
|
|
listHeightUpdated(newHeight);
|
|
|
|
}, weak->lifetime());
|
|
|
|
|
|
|
|
weak->scrollToRequests(
|
|
|
|
) | rpl::start_with_next([this](int newScrollTop) {
|
|
|
|
_scroll->scrollToY(newScrollTop);
|
|
|
|
}, weak->lifetime());
|
|
|
|
|
2018-08-14 19:12:41 +00:00
|
|
|
// MSVC BUG + REGRESSION rpl::mappers::tuple :(
|
2017-12-09 15:13:06 +00:00
|
|
|
using namespace rpl::mappers;
|
|
|
|
rpl::combine(
|
|
|
|
_scroll->scrollTopValue(),
|
2018-08-14 19:12:41 +00:00
|
|
|
_scroll->heightValue()
|
|
|
|
) | rpl::start_with_next([=](int top, int height) {
|
|
|
|
const auto bottom = top + height;
|
2017-12-09 15:13:06 +00:00
|
|
|
weak->setVisibleTopBottom(top, bottom);
|
|
|
|
}, weak->lifetime());
|
|
|
|
|
|
|
|
auto memento = Info::Media::Memento(
|
2020-06-08 09:06:50 +00:00
|
|
|
peer,
|
2017-12-09 15:13:06 +00:00
|
|
|
migratedPeerId(),
|
|
|
|
section().mediaType());
|
|
|
|
memento.setAroundId(contextId);
|
|
|
|
memento.setIdsLimit(kPlaylistIdsLimit);
|
|
|
|
memento.setScrollTopItem(contextId);
|
|
|
|
memento.setScrollTopShift(-st::infoMediaMargin.top());
|
|
|
|
weak->restoreState(&memento);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
void Panel::performDestroy() {
|
|
|
|
if (!_scroll->widget()) return;
|
|
|
|
|
2017-12-09 15:13:06 +00:00
|
|
|
_scroll->takeWidget<QWidget>().destroy();
|
|
|
|
_listPeer = _listMigratedPeer = nullptr;
|
|
|
|
_refreshListLifetime.destroy();
|
2016-10-14 17:10:15 +00:00
|
|
|
}
|
|
|
|
|
2018-01-22 19:51:38 +00:00
|
|
|
Info::Key Panel::key() const {
|
|
|
|
return Info::Key(_listPeer);
|
2017-12-09 15:13:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PeerData *Panel::migrated() const {
|
|
|
|
return _listMigratedPeer;
|
|
|
|
}
|
|
|
|
|
|
|
|
Info::Section Panel::section() const {
|
|
|
|
return Info::Section(Info::Section::MediaType::MusicFile);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Panel::startShow() {
|
2016-10-14 17:10:15 +00:00
|
|
|
ensureCreated();
|
2017-12-09 15:13:06 +00:00
|
|
|
if (contentTooSmall()) {
|
|
|
|
return;
|
2016-10-14 18:44:15 +00:00
|
|
|
}
|
|
|
|
|
2016-10-12 19:34:25 +00:00
|
|
|
if (isHidden()) {
|
2016-10-14 17:10:15 +00:00
|
|
|
scrollPlaylistToCurrentTrack();
|
2016-10-12 19:34:25 +00:00
|
|
|
show();
|
|
|
|
} else if (!_hiding) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_hiding = false;
|
|
|
|
startAnimation();
|
|
|
|
}
|
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
void Panel::hideIgnoringEnterEvents() {
|
|
|
|
_ignoringEnterEvents = true;
|
|
|
|
if (isHidden()) {
|
2016-10-26 16:43:13 +00:00
|
|
|
hideFinished();
|
2016-10-14 17:10:15 +00:00
|
|
|
} else {
|
2017-12-09 15:13:06 +00:00
|
|
|
startHide();
|
2016-10-14 17:10:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-09 15:13:06 +00:00
|
|
|
void Panel::startHideChecked() {
|
|
|
|
if (!contentTooSmall() && preventAutoHide()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (isHidden()) {
|
|
|
|
hideFinished();
|
|
|
|
} else {
|
|
|
|
startHide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Panel::startHide() {
|
2016-10-14 17:10:15 +00:00
|
|
|
if (_hiding || isHidden()) return;
|
2016-10-12 19:34:25 +00:00
|
|
|
|
|
|
|
_hiding = true;
|
|
|
|
startAnimation();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Panel::startAnimation() {
|
|
|
|
auto from = _hiding ? 1. : 0.;
|
|
|
|
auto to = _hiding ? 0. : 1.;
|
2016-10-13 15:04:40 +00:00
|
|
|
if (_cache.isNull()) {
|
2016-10-12 19:34:25 +00:00
|
|
|
showChildren();
|
2017-12-26 12:41:48 +00:00
|
|
|
_cache = Ui::GrabWidget(this);
|
2016-10-12 19:34:25 +00:00
|
|
|
}
|
|
|
|
hideChildren();
|
|
|
|
_a_appearance.start([this] { appearanceCallback(); }, from, to, st::defaultInnerDropdown.duration);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Panel::appearanceCallback() {
|
|
|
|
if (!_a_appearance.animating() && _hiding) {
|
|
|
|
_hiding = false;
|
2016-10-26 16:43:13 +00:00
|
|
|
hideFinished();
|
2016-10-12 19:34:25 +00:00
|
|
|
} else {
|
|
|
|
update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-26 16:43:13 +00:00
|
|
|
void Panel::hideFinished() {
|
2016-10-12 19:34:25 +00:00
|
|
|
hide();
|
2016-10-13 15:04:40 +00:00
|
|
|
_cache = QPixmap();
|
2016-10-14 17:10:15 +00:00
|
|
|
performDestroy();
|
2016-10-12 19:34:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int Panel::contentLeft() const {
|
|
|
|
return st::mediaPlayerPanelMarginLeft;
|
|
|
|
}
|
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
int Panel::contentTop() const {
|
2019-02-28 21:03:25 +00:00
|
|
|
return st::mediaPlayerPanelMarginLeft;
|
2016-10-13 15:04:40 +00:00
|
|
|
}
|
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
int Panel::contentRight() const {
|
2019-02-28 21:03:25 +00:00
|
|
|
return st::mediaPlayerPanelMarginLeft;
|
2016-10-14 17:10:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int Panel::contentBottom() const {
|
|
|
|
return st::mediaPlayerPanelMarginBottom;
|
|
|
|
}
|
|
|
|
|
|
|
|
int Panel::scrollMarginBottom() const {
|
2017-12-09 15:13:06 +00:00
|
|
|
return 0;// st::mediaPlayerPanelMarginBottom;
|
2016-10-12 19:34:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Player
|
|
|
|
} // namespace Media
|