[caribou/keyboard_position: 1/19] Put keyboard above text when at screen bottom.



commit 715ebb3fd91d7fa1aef96b79170bf812692ce716
Author: Eitan Isaacson <eitan monotonous org>
Date:   Fri Nov 27 11:19:41 2009 -0800

    Put keyboard above text when at screen bottom.

 src/caribou.py  |    6 +++---
 src/keyboard.py |    8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/caribou.py b/src/caribou.py
index 1e1abac..e03018f 100644
--- a/src/caribou.py
+++ b/src/caribou.py
@@ -41,7 +41,7 @@ class Test:
     def __set_text_location(self, acc):
         text = acc.queryText() 
         [x, y, width, height] = text.getCharacterExtents(text.caretOffset, pyatspi.DESKTOP_COORDS)
-        cp.set_cursor_location(x, y + height)
+        cp.set_cursor_location(x, y, width, height)
         cp.show_all()
        
     def __set_entry_location(self, acc):
@@ -50,9 +50,9 @@ class Test:
         if x == 0 and y == 0 and width == 0 and height == 0:
             component = acc.queryComponent()
             bb = component.getExtents(pyatspi.DESKTOP_COORDS)
-            cp.set_cursor_location(bb.x, bb.y + bb.height)
+            cp.set_cursor_location(bb.x, bb.y, bb.width, bb.height)
         else:
-            cp.set_cursor_location(x, y + height)
+            cp.set_cursor_location(x, y, width, height)
         cp.show_all()
        
     def on_state_changed_focused(self, event):
diff --git a/src/keyboard.py b/src/keyboard.py
index b67f88f..c9455ee 100644
--- a/src/keyboard.py
+++ b/src/keyboard.py
@@ -113,9 +113,9 @@ class CaribouWindow(gtk.VBox):
         self.__cursor_location = (0, 0)
         self.pack_start(CaribouKeyboard(qwerty))
 
-    def set_cursor_location(self, x, y):
         #print "----> SET CURSOR LOCATION"
-        self.__cursor_location = (x, y)
+    def set_cursor_location(self, x, y, width, height):
+        self.__cursor_location = (x, y, width, height)
         self.__check_position()
 
     def do_size_request(self, requisition):
@@ -137,9 +137,9 @@ class CaribouWindow(gtk.VBox):
             x = self.__cursor_location[0]
 
         if by > sy:
-            y = sy - self.__toplevel.allocation.height
+            y = self.__cursor_location[1] - self.__toplevel.allocation.height
         else:
-            y = self.__cursor_location[1]
+            y = self.__cursor_location[1] + self.__cursor_location[3]
 
         self.move(x, y)
 



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