mirror of https://github.com/procxx/kepka.git
				
				
				
			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
 | 
							// QOpenGLWidget can't properly destroy a child widget if
 | 
				
			||||||
		// it is hidden exactly after that, so it must be repainted
 | 
							// it is hidden exactly after that, so it must be repainted
 | 
				
			||||||
		// before it is hidden without the child widget.
 | 
							// before it is hidden without the child widget.
 | 
				
			||||||
		if (!isHidden() && _streamed) {
 | 
							if (!isHidden()) {
 | 
				
			||||||
			_streamed->controls.hide();
 | 
					 | 
				
			||||||
			_dropdown->hideFast();
 | 
								_dropdown->hideFast();
 | 
				
			||||||
 | 
								hideChildren();
 | 
				
			||||||
			_wasRepainted = false;
 | 
								_wasRepainted = false;
 | 
				
			||||||
			repaint();
 | 
								repaint();
 | 
				
			||||||
			if (!_wasRepainted) {
 | 
								if (!_wasRepainted) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -238,6 +238,25 @@ public:
 | 
				
			||||||
		return QMargins();
 | 
							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) {
 | 
						void moveToLeft(int x, int y, int outerw = 0) {
 | 
				
			||||||
		auto margins = getMargins();
 | 
							auto margins = getMargins();
 | 
				
			||||||
		x -= margins.left();
 | 
							x -= margins.left();
 | 
				
			||||||
| 
						 | 
					@ -348,25 +367,6 @@ public:
 | 
				
			||||||
	TWidget(QWidget *parent = nullptr) : TWidgetHelper<QWidget>(parent) {
 | 
						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.
 | 
						// Get the size of the widget as it should be.
 | 
				
			||||||
	// Negative return value means no default width.
 | 
						// Negative return value means no default width.
 | 
				
			||||||
	virtual int naturalWidth() const {
 | 
						virtual int naturalWidth() const {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue