diff options
author | Eitan Isaacson <eitan@monotonous.org> | 2009-11-27 11:19:41 -0800 |
---|---|---|
committer | Eitan Isaacson <eitan@monotonous.org> | 2009-11-27 11:19:41 -0800 |
commit | 715ebb3fd91d7fa1aef96b79170bf812692ce716 (patch) | |
tree | 1113c866f5512f2a9b2e157ce30395a0a25a535c | |
parent | 057b049defa81fd11bf4076d357bf62e353d844f (diff) | |
download | caribou-715ebb3fd91d7fa1aef96b79170bf812692ce716.tar.gz |
Put keyboard above text when at screen bottom.
-rw-r--r-- | src/caribou.py | 6 | ||||
-rw-r--r-- | 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) |