mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-11 09:19:35 +00:00
Fix macOS media viewer controls hiding.
This commit is contained in:
parent
f481f1e142
commit
3706be77ea
@ -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) {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user