mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Changing volume in media player by mouse wheel events.
This commit is contained in:
@@ -427,20 +427,6 @@ void MainWidget::rpcClear() {
|
||||
RPCSender::rpcClear();
|
||||
}
|
||||
|
||||
QPixmap MainWidget::grabInner() {
|
||||
if (_overview && !_overview->isHidden()) {
|
||||
return myGrab(_overview);
|
||||
} else if (_wideSection && !_wideSection->isHidden()) {
|
||||
return myGrab(_wideSection, QRect(0, st::topBarHeight, _history->width(), _history->height() - st::topBarHeight));
|
||||
} else if (Adaptive::OneColumn() && _history->isHidden()) {
|
||||
return myGrab(_dialogs, QRect(0, st::topBarHeight, _dialogs->width(), _dialogs->height() - st::topBarHeight));
|
||||
} else if (_history->peer()) {
|
||||
return myGrab(_history);
|
||||
} else {
|
||||
return myGrab(_history, QRect(0, st::topBarHeight, _history->width(), _history->height() - st::topBarHeight));
|
||||
}
|
||||
}
|
||||
|
||||
bool MainWidget::isItemVisible(HistoryItem *item) {
|
||||
if (isHidden() || _a_show.animating()) {
|
||||
return false;
|
||||
@@ -448,18 +434,6 @@ bool MainWidget::isItemVisible(HistoryItem *item) {
|
||||
return _history->isItemVisible(item);
|
||||
}
|
||||
|
||||
QPixmap MainWidget::grabTopBar() {
|
||||
if (!_topBar->isHidden()) {
|
||||
return myGrab(_topBar);
|
||||
} else if (_wideSection) {
|
||||
return myGrab(_wideSection, QRect(0, 0, _wideSection->width(), st::topBarHeight));
|
||||
} else if (Adaptive::OneColumn() && _history->isHidden()) {
|
||||
return myGrab(_dialogs, QRect(0, 0, _dialogs->width(), st::topBarHeight));
|
||||
} else {
|
||||
return myGrab(_history, QRect(0, 0, _history->width(), st::topBarHeight));
|
||||
}
|
||||
}
|
||||
|
||||
void MainWidget::notify_botCommandsChanged(UserData *bot) {
|
||||
_history->notify_botCommandsChanged(bot);
|
||||
}
|
||||
@@ -2335,6 +2309,10 @@ Window::SectionSlideParams MainWidget::prepareShowAnimation(bool willHaveTopBarS
|
||||
if (_player) {
|
||||
_player->hideShadow();
|
||||
}
|
||||
auto playerVolumeVisible = _playerVolume && !_playerVolume->isHidden();
|
||||
if (playerVolumeVisible) {
|
||||
_playerVolume->hide();
|
||||
}
|
||||
if (selectingPeer() && Adaptive::OneColumn()) {
|
||||
result.oldContentCache = myGrab(this, QRect(0, _playerHeight, _dialogsWidth, height() - _playerHeight));
|
||||
} else if (_wideSection) {
|
||||
@@ -2357,6 +2335,9 @@ Window::SectionSlideParams MainWidget::prepareShowAnimation(bool willHaveTopBarS
|
||||
if (_overview) _overview->grabFinish();
|
||||
_history->grabFinish();
|
||||
}
|
||||
if (playerVolumeVisible) {
|
||||
_playerVolume->show();
|
||||
}
|
||||
if (_player) {
|
||||
_player->showShadow();
|
||||
}
|
||||
@@ -2482,6 +2463,10 @@ QPixmap MainWidget::grabForShowAnimation(const Window::SectionSlideParams ¶m
|
||||
if (_player) {
|
||||
_player->hideShadow();
|
||||
}
|
||||
auto playerVolumeVisible = _playerVolume && !_playerVolume->isHidden();
|
||||
if (playerVolumeVisible) {
|
||||
_playerVolume->hide();
|
||||
}
|
||||
if (Adaptive::OneColumn()) {
|
||||
result = myGrab(this, QRect(0, _playerHeight, _dialogsWidth, height() - _playerHeight));
|
||||
} else {
|
||||
@@ -2489,6 +2474,9 @@ QPixmap MainWidget::grabForShowAnimation(const Window::SectionSlideParams ¶m
|
||||
result = myGrab(this, QRect(_dialogsWidth, _playerHeight, width() - _dialogsWidth, height() - _playerHeight));
|
||||
_sideShadow->show();
|
||||
}
|
||||
if (playerVolumeVisible) {
|
||||
_playerVolume->show();
|
||||
}
|
||||
if (_player) {
|
||||
_player->showShadow();
|
||||
}
|
||||
|
Reference in New Issue
Block a user