mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-27 09:03:02 +00:00
Fix video seeking.
Regression was introduced in d0e854e9d8
.
Each time you hide() a widget its mousePress state is reset and
mouseMoveEvent() / mouseReleaseEvent() handlers are never called.
So you can't toggle (hide + show) widgets that are mouse-pressed.
Fixes #4802.
This commit is contained in:
parent
4a4544c883
commit
777bf7d8d9
@ -79,17 +79,21 @@ template <typename Callback>
|
||||
void Controller::startFading(Callback start) {
|
||||
if (!_fadeAnimation->animating()) {
|
||||
showChildren();
|
||||
_playbackSlider->hide();
|
||||
_playbackSlider->disablePaint(true);
|
||||
_childrenHidden = false;
|
||||
}
|
||||
start();
|
||||
if (_fadeAnimation->animating()) {
|
||||
hideChildren();
|
||||
for (const auto child : children()) {
|
||||
if (child->isWidgetType() && child != _playbackSlider) {
|
||||
static_cast<QWidget*>(child)->hide();
|
||||
}
|
||||
}
|
||||
_childrenHidden = true;
|
||||
} else {
|
||||
fadeFinished();
|
||||
}
|
||||
_playbackSlider->show();
|
||||
_playbackSlider->disablePaint(false);
|
||||
}
|
||||
|
||||
void Controller::showAnimated() {
|
||||
|
@ -2961,9 +2961,6 @@ bool MediaView::eventFilter(QObject *obj, QEvent *e) {
|
||||
activate = true;
|
||||
}
|
||||
if (activate) {
|
||||
if (_controlsState == ControlsHiding || _controlsState == ControlsHidden) {
|
||||
int a = 0;
|
||||
}
|
||||
activateControls();
|
||||
}
|
||||
}
|
||||
|
@ -195,7 +195,14 @@ float64 MediaSlider::getOverDuration() const {
|
||||
return _st.duration;
|
||||
}
|
||||
|
||||
void MediaSlider::disablePaint(bool disabled) {
|
||||
_paintDisabled = disabled;
|
||||
}
|
||||
|
||||
void MediaSlider::paintEvent(QPaintEvent *e) {
|
||||
if (_paintDisabled) {
|
||||
return;
|
||||
}
|
||||
Painter p(this);
|
||||
PainterHighQualityEnabler hq(p);
|
||||
|
||||
|
@ -124,6 +124,7 @@ public:
|
||||
_alwaysDisplayMarker = alwaysDisplayMarker;
|
||||
update();
|
||||
}
|
||||
void disablePaint(bool disabled);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *e) override;
|
||||
@ -134,6 +135,7 @@ private:
|
||||
|
||||
const style::MediaSlider &_st;
|
||||
bool _alwaysDisplayMarker = false;
|
||||
bool _paintDisabled = false;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user