[orca] Set position of the navlist over the document



commit 3713ca485b2f100166d11c80a0d926ea02c95cf0
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Nov 28 16:22:38 2018 -0500

    Set position of the navlist over the document

 src/orca/orca_gui_navlist.py |  4 ++++
 src/orca/script_utilities.py | 10 ++++++++++
 2 files changed, 14 insertions(+)
---
diff --git a/src/orca/orca_gui_navlist.py b/src/orca/orca_gui_navlist.py
index 1d1fb4285..8f92d21fc 100644
--- a/src/orca/orca_gui_navlist.py
+++ b/src/orca/orca_gui_navlist.py
@@ -109,6 +109,10 @@ class OrcaNavListGUI:
 
     def showGUI(self):
         self._document = self._script.utilities.documentFrame()
+        x, y, width, height = self._script.utilities.getBoundingBox(self._document)
+        if (width and height):
+            self._gui.move(x + 100, y + 100)
+
         self._gui.show_all()
         ts = orca_state.lastInputEvent.timestamp
         if ts == 0:
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 7b8be9116..237298232 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -2267,6 +2267,16 @@ class Utilities:
 
         return rv
 
+    def getBoundingBox(self, obj):
+        try:
+            extents = obj.queryComponent().getExtents(pyatspi.DESKTOP_COORDS)
+        except:
+            msg = "ERROR: Exception getting extents of %s" % obj
+            debug.println(debug.LEVEL_INFO, msg, True)
+            return -1, -1, 0, 0
+
+        return extents.x, extents.y, extents.width, extents.height
+
     def hasNoSize(self, obj):
         if not obj:
             return False


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]