Fix browser eventFilter/scroll hack

This commit is contained in:
Florian Bruhin 2014-02-05 15:59:54 +01:00
parent ac33da82a2
commit 0005c1d0a7

View File

@ -428,6 +428,7 @@ class BrowserTab(QWebView):
new_pos = (frame.scrollBarValue(Qt.Horizontal),
frame.scrollBarValue(Qt.Vertical))
if self._scroll_pos != new_pos:
self._scroll_pos = new_pos
logging.debug("Updating scroll position")
frame = self.page().mainFrame()
m = (frame.scrollBarMaximum(Qt.Horizontal),
@ -435,6 +436,8 @@ class BrowserTab(QWebView):
perc = (round(100 * new_pos[0] / m[0]) if m[0] != 0 else 0,
round(100 * new_pos[1] / m[1]) if m[1] != 0 else 0)
self.scroll_pos_changed.emit(*perc)
# we're not actually filtering something, let superclass handle the
# event
return super().eventFilter(watched, e)
def event(self, e):