2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

New media player layout started.

This commit is contained in:
John Preston
2016-09-17 22:28:33 +03:00
parent 50fa8b63c9
commit ce1973fd30
13 changed files with 448 additions and 0 deletions

View File

@@ -50,6 +50,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "localstorage.h"
#include "shortcuts.h"
#include "media/media_audio.h"
#include "media/player/media_player_button.h"
#include "media/player/media_player_widget.h"
#include "core/qthelp_regex.h"
#include "core/qthelp_url.h"
#include "window/chat_background.h"
@@ -75,6 +77,11 @@ MainWidget::MainWidget(MainWindow *window) : TWidget(window)
, _api(new ApiWrap(this)) {
setGeometry(QRect(0, st::titleHeight, App::wnd()->width(), App::wnd()->height() - st::titleHeight));
if (!_mediaPlayer) {
_mediaPlayer = new Media::Player::Widget(this);
App::wnd()->getTitle()->playerButton()->installEventFilter(_mediaPlayer);
}
MTP::setGlobalDoneHandler(rpcDone(&MainWidget::updateReceived));
_ptsWaiter.setRequesting(true);
updateScrollColors();
@@ -2405,6 +2412,7 @@ void MainWidget::orderWidgets() {
_dialogs->raise();
_mediaType->raise();
_sideShadow.raise();
if (_mediaPlayer) _mediaPlayer->raise();
if (_hider) _hider->raise();
}
@@ -2664,6 +2672,9 @@ inline int chatsListWidth(int windowWidth) {
void MainWidget::resizeEvent(QResizeEvent *e) {
int32 tbh = _topBar->isHidden() ? 0 : st::topBarHeight;
if (_mediaPlayer) {
_mediaPlayer->moveToRight(0, 0);
}
if (Adaptive::OneColumn()) {
_dialogsWidth = width();
_player->setGeometry(0, 0, _dialogsWidth, _player->height());