@@ -32,16 +32,20 @@ class DefaultIndicatorWidget(UnityEmulatorBase):
32 # TODO: submit to autopilot.introspection.types.Rectangle
32 # TODO: submit to autopilot.introspection.types.Rectangle
33 def get_center(self):
33 def get_center(self):
34 """Returns (x, y) representing the center of a globalRect."""
34 """Returns (x, y) representing the center of a globalRect."""
35− return (self.globalRect[0]+int(self.globalRect[2]/2),
36+ self.globalRect[0]+int(self.globalRect[2]/2),
36− self.globalRect[1]+int(self.globalRect[3]/2))
37+ self.globalRect[1]+int(self.globalRect[3]/2)
38 def swipe_to_open_indicator(self, window):
40 def swipe_to_open_indicator(self, window):
39 """Swipe to open the indicator, wait until it's open."""
41 """Swipe to open the indicator, wait until it's open."""
40 start_x, start_y = self.get_center()
42 start_x, start_y = self.get_center()
41 end_x = start_x
43 end_x = start_x
42 end_y = window.height
44 end_y = window.height
43− self.pointer.drag(start_x, start_y,
45+ self.pointer.drag(
44− end_x, end_y)
47+ end_x, end_y
45 # TODO: assert that the indicator page opened
49 # TODO: assert that the indicator page opened
47 def swipe_to_close_indicator(self, window):
51 def swipe_to_close_indicator(self, window):
@@ -49,6 +53,8 @@ class DefaultIndicatorWidget(UnityEmulatorBase):
49 end_x, end_y = self.get_center()
53 end_x, end_y = self.get_center()
50 start_x = end_x
54 start_x = end_x
51 start_y = window.height
55 start_y = window.height
52− self.pointer.drag(start_x, start_y,
56+ self.pointer.drag(
53− end_x, end_y)
58+ end_x, end_y
54 # TODO: assert that the indicator page closed
60 # TODO: assert that the indicator page closed