Handle resizing via PseudoLayout
This fixes the scenario where we just get a grey view when opening a link in a tab from DuckDuckGo.
This commit is contained in:
parent
ec6c5ebb69
commit
5147fc832c
@ -73,11 +73,6 @@ class WebEngineView(QWebEngineView):
|
|||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
self.page().shutdown()
|
self.page().shutdown()
|
||||||
|
|
||||||
def resizeEvent(self, _event):
|
|
||||||
widget = self.render_widget()
|
|
||||||
if widget is not None:
|
|
||||||
widget.setGeometry(self.rect())
|
|
||||||
|
|
||||||
def createWindow(self, wintype):
|
def createWindow(self, wintype):
|
||||||
"""Called by Qt when a page wants to create a new window.
|
"""Called by Qt when a page wants to create a new window.
|
||||||
|
|
||||||
|
@ -281,6 +281,20 @@ class PseudoLayout(QLayout):
|
|||||||
def itemAt(self, _pos):
|
def itemAt(self, _pos):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def widget(self):
|
||||||
|
return self.parent().render_widget()
|
||||||
|
|
||||||
|
def setGeometry(self, rect):
|
||||||
|
widget = self.widget()
|
||||||
|
if widget is not None:
|
||||||
|
widget.setGeometry(rect)
|
||||||
|
|
||||||
|
def sizeHint(self):
|
||||||
|
widget = self.widget()
|
||||||
|
if widget is not None:
|
||||||
|
return widget.sizeHint()
|
||||||
|
return QSize()
|
||||||
|
|
||||||
|
|
||||||
class FullscreenNotification(QLabel):
|
class FullscreenNotification(QLabel):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user