Fix macOS media viewer controls hiding.

This commit is contained in:
John Preston 2019-03-08 16:57:52 +04:00
parent f481f1e142
commit 3706be77ea
2 changed files with 21 additions and 21 deletions

View File

@ -3491,9 +3491,9 @@ void OverlayWidget::setVisibleHook(bool visible) {
// QOpenGLWidget can't properly destroy a child widget if
// it is hidden exactly after that, so it must be repainted
// before it is hidden without the child widget.
if (!isHidden() && _streamed) {
_streamed->controls.hide();
if (!isHidden()) {
_dropdown->hideFast();
hideChildren();
_wasRepainted = false;
repaint();
if (!_wasRepainted) {

View File

@ -238,6 +238,25 @@ public:
return QMargins();
}
bool inFocusChain() const {
return Ui::InFocusChain(this);
}
void hideChildren() {
for (auto child : Base::children()) {
if (child->isWidgetType()) {
static_cast<QWidget*>(child)->hide();
}
}
}
void showChildren() {
for (auto child : Base::children()) {
if (child->isWidgetType()) {
static_cast<QWidget*>(child)->show();
}
}
}
void moveToLeft(int x, int y, int outerw = 0) {
auto margins = getMargins();
x -= margins.left();
@ -348,25 +367,6 @@ public:
TWidget(QWidget *parent = nullptr) : TWidgetHelper<QWidget>(parent) {
}
bool inFocusChain() const {
return Ui::InFocusChain(this);
}
void hideChildren() {
for (auto child : children()) {
if (child->isWidgetType()) {
static_cast<QWidget*>(child)->hide();
}
}
}
void showChildren() {
for (auto child : children()) {
if (child->isWidgetType()) {
static_cast<QWidget*>(child)->show();
}
}
}
// Get the size of the widget as it should be.
// Negative return value means no default width.
virtual int naturalWidth() const {