From 419caf7116db948cd25afc203c1601f21fdfa67d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 12 May 2014 10:05:00 +0200 Subject: [PATCH] Rename rect_on_screen to rect_on_view --- qutebrowser/browser/hints.py | 2 +- qutebrowser/utils/webelem.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index c204346bc..a9df0712c 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -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 = [ diff --git a/qutebrowser/utils/webelem.py b/qutebrowser/utils/webelem.py index 2557a23e8..2d9bcb468 100644 --- a/qutebrowser/utils/webelem.py +++ b/qutebrowser/utils/webelem.py @@ -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: