Always click elements in the center when hinting

This commit is contained in:
Florian Bruhin 2014-05-06 21:07:20 +02:00
parent f2797d09b4
commit 164dcfb6bd

View File

@ -244,13 +244,10 @@ class HintManager(QObject):
else: else:
target = self._target target = self._target
self.set_open_target.emit(Target[target]) self.set_open_target.emit(Target[target])
# FIXME this is a quick & dirty fix, we should: # FIXME Instead of clicking the center, we could have nicer heuristics.
# a) Have better heuristics where to click at (e.g. end of input # e.g. parse (-webkit-)border-radius correctly and click text fields at
# fields) # the bottom right, and everything else on the top left or so.
# b) Check border/margin/padding to know where to click point = elem.geometry().center()
# Hinting failed here for example:
# https://lsf.fh-worms.de/
point = elem.geometry().topLeft() + QPoint(1, 1)
scrollpos = self._frame.scrollPosition() scrollpos = self._frame.scrollPosition()
logging.debug("Clicking on \"{}\" at {}/{} - {}/{}".format( logging.debug("Clicking on \"{}\" at {}/{} - {}/{}".format(
elem.toPlainText(), point.x(), point.y(), scrollpos.x(), elem.toPlainText(), point.x(), point.y(), scrollpos.x(),