mirror of https://github.com/procxx/kepka.git
Fixed tooltip display when hiding media player panel.
This commit is contained in:
parent
5d6dafeeda
commit
fa0e255183
|
@ -1752,6 +1752,7 @@ void HistoryInner::leaveEvent(QEvent *e) {
|
||||||
App::hoveredItem(nullptr);
|
App::hoveredItem(nullptr);
|
||||||
}
|
}
|
||||||
ClickHandler::clearActive();
|
ClickHandler::clearActive();
|
||||||
|
PopupTooltip::Hide();
|
||||||
if (!ClickHandler::getPressed() && _cursor != style::cur_default) {
|
if (!ClickHandler::getPressed() && _cursor != style::cur_default) {
|
||||||
_cursor = style::cur_default;
|
_cursor = style::cur_default;
|
||||||
setCursor(_cursor);
|
setCursor(_cursor);
|
||||||
|
@ -2292,9 +2293,11 @@ QPoint HistoryInner::tooltipPos() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryInner::onParentGeometryChanged() {
|
void HistoryInner::onParentGeometryChanged() {
|
||||||
bool needToUpdate = (_dragAction != NoDrag || _touchScroll || rect().contains(mapFromGlobal(QCursor::pos())));
|
auto mousePos = QCursor::pos();
|
||||||
|
auto mouseOver = _widget->rect().contains(_widget->mapFromGlobal(mousePos));
|
||||||
|
auto needToUpdate = (_dragAction != NoDrag || _touchScroll || mouseOver);
|
||||||
if (needToUpdate) {
|
if (needToUpdate) {
|
||||||
dragActionUpdate(QCursor::pos());
|
dragActionUpdate(mousePos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,13 @@ void Panel::resizeEvent(QResizeEvent *e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Panel::onListHeightUpdated() {
|
void Panel::onListHeightUpdated() {
|
||||||
|
if (auto widget = _scroll->widget()) {
|
||||||
|
if (widget->height() > 0 || _cover) {
|
||||||
updateSize();
|
updateSize();
|
||||||
|
} else {
|
||||||
|
hideIgnoringEnterEvents();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Panel::updateControlsGeometry() {
|
void Panel::updateControlsGeometry() {
|
||||||
|
@ -108,10 +114,6 @@ void Panel::scrollPlaylistToCurrentTrack() {
|
||||||
auto rect = list->getCurrentTrackGeometry();
|
auto rect = list->getCurrentTrackGeometry();
|
||||||
auto top = _scroll->scrollTop(), bottom = top + _scroll->height();
|
auto top = _scroll->scrollTop(), bottom = top + _scroll->height();
|
||||||
_scroll->scrollToY(rect.y());
|
_scroll->scrollToY(rect.y());
|
||||||
//if (top > rect.y()) {
|
|
||||||
//} else if (bottom < rect.y() + rect.height()) {
|
|
||||||
// _scroll->scrollToY(rect.y() + rect.height() - _scroll->height());
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +132,7 @@ void Panel::updateSize() {
|
||||||
height += _cover->height();
|
height += _cover->height();
|
||||||
}
|
}
|
||||||
auto listHeight = 0;
|
auto listHeight = 0;
|
||||||
if (auto widget = static_cast<ScrolledWidget*>(_scroll->widget())) {
|
if (auto widget = _scroll->widget()) {
|
||||||
listHeight = widget->height();
|
listHeight = widget->height();
|
||||||
}
|
}
|
||||||
auto scrollVisible = (listHeight > 0);
|
auto scrollVisible = (listHeight > 0);
|
||||||
|
@ -261,6 +263,12 @@ void Panel::setPinCallback(PinCallback &&callback) {
|
||||||
|
|
||||||
void Panel::onShowStart() {
|
void Panel::onShowStart() {
|
||||||
ensureCreated();
|
ensureCreated();
|
||||||
|
if (auto widget = _scroll->widget()) {
|
||||||
|
if (widget->height() <= 0 && !_cover) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (isHidden()) {
|
if (isHidden()) {
|
||||||
scrollPlaylistToCurrentTrack();
|
scrollPlaylistToCurrentTrack();
|
||||||
show();
|
show();
|
||||||
|
|
|
@ -210,14 +210,12 @@ void Widget::handleSeekFinished(float64 progress) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::resizeEvent(QResizeEvent *e) {
|
void Widget::resizeEvent(QResizeEvent *e) {
|
||||||
updatePlayPrevNextPositions();
|
|
||||||
|
|
||||||
auto right = st::mediaPlayerCloseRight;
|
auto right = st::mediaPlayerCloseRight;
|
||||||
_close->moveToRight(right, st::mediaPlayerPlayTop); right += _close->width();
|
_close->moveToRight(right, st::mediaPlayerPlayTop); right += _close->width();
|
||||||
_repeatTrack->moveToRight(right, st::mediaPlayerPlayTop); right += _repeatTrack->width();
|
_repeatTrack->moveToRight(right, st::mediaPlayerPlayTop); right += _repeatTrack->width();
|
||||||
_volumeToggle->moveToRight(right, st::mediaPlayerPlayTop); right += _volumeToggle->width();
|
_volumeToggle->moveToRight(right, st::mediaPlayerPlayTop); right += _volumeToggle->width();
|
||||||
|
|
||||||
updateLabelsGeometry();
|
updatePlayPrevNextPositions();
|
||||||
|
|
||||||
_playback->setGeometry(0, height() - st::mediaPlayerPlayback.fullWidth, width(), st::mediaPlayerPlayback.fullWidth);
|
_playback->setGeometry(0, height() - st::mediaPlayerPlayback.fullWidth, width(), st::mediaPlayerPlayback.fullWidth);
|
||||||
}
|
}
|
||||||
|
@ -262,6 +260,7 @@ void Widget::updatePlayPrevNextPositions() {
|
||||||
} else {
|
} else {
|
||||||
_playPause->moveToLeft(left, top);
|
_playPause->moveToLeft(left, top);
|
||||||
}
|
}
|
||||||
|
updateLabelsGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
int Widget::getLabelsLeft() const {
|
int Widget::getLabelsLeft() const {
|
||||||
|
|
|
@ -139,7 +139,6 @@ private:
|
||||||
a_height.finish();
|
a_height.finish();
|
||||||
_a_height.stop();
|
_a_height.stop();
|
||||||
_forceHeight = _hiding ? 0 : -1;
|
_forceHeight = _hiding ? 0 : -1;
|
||||||
sendSynteticMouseEvent(this, QEvent::MouseMove, Qt::NoButton);
|
|
||||||
if (_hiding) hide();
|
if (_hiding) hide();
|
||||||
} else {
|
} else {
|
||||||
a_height.update(dt, anim::linear);
|
a_height.update(dt, anim::linear);
|
||||||
|
|
Loading…
Reference in New Issue