Пример #1
0
 def on_touch_start(self, x: int, y: int) -> None:
     if self.state is _DISABLED:
         return
     if in_area(self.area, x, y):
         self.state = _PRESSED
         self.repaint = True
         self.on_press_start()
Пример #2
0
 def on_touch_end(self, x: int, y: int) -> None:
     state = self.state
     if state is not _INITIAL and state is not _DISABLED:
         self.state = _INITIAL
         self.repaint = True
     if in_area(self.area, x, y):
         if state is _PRESSED:
             self.on_press_end()
             self.on_click()
Пример #3
0
 def on_touch_move(self, x: int, y: int) -> None:
     if self.state is _DISABLED:
         return
     if in_area(self.area, x, y):
         if self.state is _RELEASED:
             self.state = _PRESSED
             self.repaint = True
             self.on_press_start()
     else:
         if self.state is _PRESSED:
             self.state = _RELEASED
             self.repaint = True
             self.on_press_end()
Пример #4
0
 def on_touch_start(self, x, y):
     if ui.in_area(self.area, x, y):
         self.start_x = x
         self.start_y = y
         self.light_origin = ui.BACKLIGHT_NORMAL
Пример #5
0
 def on_touch_start(self, x: int, y: int) -> None:
     if ui.in_area(self.area, x, y):
         self.start_x = x
         self.start_y = y
         self.light_origin = ui.BACKLIGHT_NORMAL
         self.started = True