Rename rect_on_screen to rect_on_view

This commit is contained in:
Florian Bruhin 2014-05-12 10:05:00 +02:00
parent 50f31ca7cb
commit 419caf7116
2 changed files with 4 additions and 4 deletions

View File

@ -247,7 +247,7 @@ class HintManager(QObject):
# FIXME Instead of clicking the center, we could have nicer heuristics.
# e.g. parse (-webkit-)border-radius correctly and click text fields at
# the bottom right, and everything else on the top left or so.
pos = webelem.rect_on_screen(elem).center()
pos = webelem.rect_on_view(elem).center()
logging.debug("Clicking on \"{}\" at {}/{}".format(
elem.toPlainText(), pos.x(), pos.y()))
events = [

View File

@ -74,7 +74,7 @@ def is_visible(elem, mainframe):
# Most likely an invisible link
return False
# First check if the element is visible on screen
elem_rect = rect_on_screen(elem)
elem_rect = rect_on_view(elem)
visible_on_screen = mainframe.geometry().intersects(elem_rect)
# Then check if it's visible in its frame if it's not in the main frame.
elem_frame = elem.webFrame()
@ -88,8 +88,8 @@ def is_visible(elem, mainframe):
return all([visible_on_screen, visible_in_frame])
def rect_on_screen(elem):
"""Get the geometry of the element relative to the screen."""
def rect_on_view(elem):
"""Get the geometry of the element relative to the webview."""
frame = elem.webFrame()
rect = elem.geometry()
while frame is not None: