Always click elements in the center when hinting
This commit is contained in:
parent
f2797d09b4
commit
164dcfb6bd
@ -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(),
|
||||||
|
Loading…
Reference in New Issue
Block a user