[caribou/keyboard_position: 12/19] seperate calculating position and moving



commit f543b33e104cc63892f056f44a32172b545a9509
Author: Eitan Isaacson <eitan monotonous org>
Date:   Tue Dec 1 16:07:15 2009 -0800

    seperate calculating position and moving

 src/keyboard.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/keyboard.py b/src/keyboard.py
index c132421..0511c5f 100644
--- a/src/keyboard.py
+++ b/src/keyboard.py
@@ -143,7 +143,7 @@ class CaribouHoverWindow(CaribouWindow):
         args = root_window.get_position() + root_window.get_size()
         return gdk.Rectangle(*args)
             
-    def _update_position(self, placement=None):
+    def _calculate_position(self, placement=None):
         root_bbox = self._get_root_bbox()
         placement = placement or self._default_placement
 
@@ -156,7 +156,10 @@ class CaribouHoverWindow(CaribouWindow):
         x += placement.x.adjust_to_bounds(root_bbox, proposed_position)
         y += placement.y.adjust_to_bounds(root_bbox, proposed_position)
 
-        self.move(x, y)
+        return x, y
+
+    def _update_position(self):
+        self.move(*self._calculate_position())
 
     def _calculate_axis(self, axis_placement, root_bbox):
         bbox = root_bbox



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