snakeware

Python-based Linux distro for x86-64 and RPi
git clone git://squid-tech.com/snakeware.git
Log | Files | Refs | README

commit 6d68224fc63ed19780a9d8266695dd0ec1f140d3
parent d5ea3126ae6cfd08907894df9c0e21020805faa1
Author: Josh Moore <jxm5210@g.rit.edu>
Date:   Sat,  6 Jun 2020 15:39:39 -0400

Merge pull request #82 from mdoege/aclock_resize

Make aclock resizable
Diffstat:
Msnakewm/apps/tools/aclock/aclock.py | 12++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/snakewm/apps/tools/aclock/aclock.py b/snakewm/apps/tools/aclock/aclock.py @@ -22,8 +22,8 @@ class SnakeAClock(pygame_gui.elements.UIWindow): pygame.Rect(pos, (self.DIMS[0] + 32, self.DIMS[1] + 60)), manager=manager, window_display_title="aclock", - object_id="#aclockterm", - resizable=False, + object_id="#aclock", + resizable=True, ) self.dsurf = UIImage( @@ -35,9 +35,17 @@ class SnakeAClock(pygame_gui.elements.UIWindow): ) self.draw_dial() self.clean_dial = self.dial.copy() + self.manager = manager def process_event(self, event): super().process_event(event) + r = super().get_abs_rect() + if event.type == pygame.MOUSEBUTTONUP and ( + r.w != self.DIMS[0] + 32 or r.h != self.DIMS[1] + 60 + ): + self.DIMS = r.w - 32, r.h - 60 + super().kill() + self.__init__((r.left, r.top), self.manager) def update(self, delta): super().update(delta)