def on_mouse_press(self, x, y, button, modifiers): if button == pyglet.window.mouse.LEFT and self.topbar.hit_test(x - self._gx, y - self._gy): self.collapsed = not self.collapsed return pyglet.event.EVENT_HANDLED SingleContainer.on_mouse_press(self, x, y, button, modifiers) return pyglet.event.EVENT_UNHANDLED
def on_mouse_press(self, x, y, button, modifiers): if button == pyglet.window.mouse.LEFT and \ self.topbar.hit_test(x - self._gx, y - self._gy): self.collapsed = not self.collapsed return pyglet.event.EVENT_HANDLED SingleContainer.on_mouse_press(self, x, y, button, modifiers) return pyglet.event.EVENT_UNHANDLED
def on_mouse_press(self, x, y, button, modifiers): if button == pyglet.window.mouse.LEFT and \ self.topbar.hit_test(x - self.x, y - self.y): self._in_drag = True self._offset_x = x - self.x self._offset_y = y - self.y return pyglet.event.EVENT_HANDLED SingleContainer.on_mouse_press(self, x, y, button, modifiers) return pyglet.event.EVENT_UNHANDLED
def on_mouse_press(self, x, y, button, modifiers): if button == pyglet.window.mouse.LEFT and \ self.topbar.hit_test(x - self.x, y - self.y): self._in_drag = True self._offset_x = x - self.x self._offset_y = y - self.y return pyglet.event.EVENT_HANDLED SingleContainer.on_mouse_press(self, x, y, button, modifiers) return pyglet.event.EVENT_UNHANDLED
def on_mouse_press(self, x, y, button, modifiers): if button == pyglet.window.mouse.LEFT and \ self.topbar.hit_test(x - self._gx, y - self._gy): self._collapsed = not self._collapsed self._h, self._last_h = self._last_h, self._h self.elements['topbar'].patch = self.theme['folding_box'][('image_closed' if self._collapsed else 'image')] self.find_root().update_layout() return pyglet.event.EVENT_HANDLED SingleContainer.on_mouse_press(self, x, y, button, modifiers) return pyglet.event.EVENT_UNHANDLED
def on_mouse_press(self, x, y, button, modifiers): if button == pyglet.window.mouse.LEFT and \ self.topbar.hit_test(x - self.x, y - self.y): self._in_drag = True self._offset_x = x - self.x self._offset_y = y - self.y return pyglet.event.EVENT_HANDLED if self.resizeable and button == pyglet.window.mouse.LEFT and \ self.elements['resize'].hit_test(x - self.x, y - self.y): self._in_resize = True self._orig_y = self.y self._orig_h = self.h self._offset_x = x - self.x - self.w self._offset_y = y - self.y return pyglet.event.EVENT_HANDLED SingleContainer.on_mouse_press(self, x, y, button, modifiers) return pyglet.event.EVENT_UNHANDLED