Handle scrolled frame correctly
This commit is contained in:
parent
979685e37a
commit
67bf654d57
@ -290,15 +290,20 @@ class HintManager(QObject):
|
|||||||
def fire(self, keystr):
|
def fire(self, keystr):
|
||||||
"""Fire a completed hint."""
|
"""Fire a completed hint."""
|
||||||
elem = self._elems[keystr].elem
|
elem = self._elems[keystr].elem
|
||||||
logging.debug("Clicking on: {}".format(elem.toPlainText()))
|
|
||||||
self.stop()
|
self.stop()
|
||||||
|
point = elem.geometry().topLeft()
|
||||||
|
scrollpos = self._frame.scrollPosition()
|
||||||
|
logging.debug("Clicking on \"{}\" at {}/{} - {}/{}".format(
|
||||||
|
elem.toPlainText(), point.x(), point.y(), scrollpos.x(),
|
||||||
|
scrollpos.y()))
|
||||||
|
point -= scrollpos
|
||||||
events = [
|
events = [
|
||||||
QMouseEvent(QEvent.MouseMove, elem.geometry().topLeft(),
|
QMouseEvent(QEvent.MouseMove, point, Qt.NoButton, Qt.NoButton,
|
||||||
Qt.NoButton, Qt.NoButton, Qt.NoModifier),
|
Qt.NoModifier),
|
||||||
QMouseEvent(QEvent.MouseButtonPress, elem.geometry().topLeft(),
|
QMouseEvent(QEvent.MouseButtonPress, point, Qt.LeftButton,
|
||||||
Qt.LeftButton, Qt.NoButton, Qt.NoModifier),
|
Qt.NoButton, Qt.NoModifier),
|
||||||
QMouseEvent(QEvent.MouseButtonRelease, elem.geometry().topLeft(),
|
QMouseEvent(QEvent.MouseButtonRelease, point, Qt.LeftButton,
|
||||||
Qt.LeftButton, Qt.NoButton, Qt.NoModifier),
|
Qt.NoButton, Qt.NoModifier),
|
||||||
]
|
]
|
||||||
for evt in events:
|
for evt in events:
|
||||||
self.mouse_event.emit(evt)
|
self.mouse_event.emit(evt)
|
||||||
|
Loading…
Reference in New Issue
Block a user