diff --git a/src/code.py b/src/code.py index f5f96d0..acf9a82 100644 --- a/src/code.py +++ b/src/code.py @@ -34,7 +34,7 @@ bg_tg = displayio.TileGrid(bitmap=background_bmp, pixel_shader=bg_palette) main_group.append(bg_tg) # load the mouse cursor bitmap -mouse_bmp = displayio.OnDiskBitmap("mouse_cursor.bmp") +mouse_bmp = displayio.OnDiskBitmap("launcher_assets/mouse_cursor.bmp") # make the background pink pixels transparent mouse_bmp.pixel_shader.make_transparent(0) @@ -150,7 +150,7 @@ config = { cell_width = WIDTH // config["width"] -default_icon_bmp, default_icon_palette = adafruit_imageload.load("default_icon_64.bmp") +default_icon_bmp, default_icon_palette = adafruit_imageload.load("launcher_assets/default_icon.bmp") default_icon_palette.make_transparent(0) menu_grid = GridLayout(x=10, y=26, width=WIDTH, height=HEIGHT, grid_size=(config["width"], config["height"]), divider_lines=False) @@ -197,9 +197,9 @@ for path in app_path.iterdir(): menu_grid.add_content(cell_group, grid_position=(i % config["width"], i // config["width"]), cell_size=(1, 1)) i += 1 -left_bmp, left_palette = adafruit_imageload.load("arrow_left.bmp") +left_bmp, left_palette = adafruit_imageload.load("launcher_assets/arrow_left.bmp") left_palette.make_transparent(0) -right_bmp, right_palette = adafruit_imageload.load("arrow_right.bmp") +right_bmp, right_palette = adafruit_imageload.load("launcher_assets/arrow_right.bmp") right_palette.make_transparent(0) left_tg = AnchoredTileGrid(bitmap=left_bmp, pixel_shader=left_palette) diff --git a/src/arrow_left.bmp b/src/launcher_assets/arrow_left.bmp similarity index 100% rename from src/arrow_left.bmp rename to src/launcher_assets/arrow_left.bmp diff --git a/src/arrow_right.bmp b/src/launcher_assets/arrow_right.bmp similarity index 100% rename from src/arrow_right.bmp rename to src/launcher_assets/arrow_right.bmp diff --git a/src/launcher_assets/default_icon.bmp b/src/launcher_assets/default_icon.bmp new file mode 100644 index 0000000..9112f8d Binary files /dev/null and b/src/launcher_assets/default_icon.bmp differ diff --git a/src/mouse_cursor.bmp b/src/launcher_assets/mouse_cursor.bmp similarity index 100% rename from src/mouse_cursor.bmp rename to src/launcher_assets/mouse_cursor.bmp diff --git a/src/sized_group.py b/src/sized_group.py deleted file mode 100644 index b16f680..0000000 --- a/src/sized_group.py +++ /dev/null @@ -1,49 +0,0 @@ -import displayio - -class SizedGroup(displayio.Group): - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - - - @property - def size(self): - min_x = 0 - min_y = 0 - max_x = 0 - max_y = 0 - - for element in self: - # print(type(element)) - if type(element) == displayio.TileGrid: - if element.x < min_x: - min_x = element.x - if element.y < min_y: - min_y = element.y - - _element_max_x = element.x + (element.width * element.tile_width) - _element_max_y = element.y + (element.height * element.tile_height) - if _element_max_x > max_x: - max_x = _element_max_x - if _element_max_y > max_y: - max_y = _element_max_y - else: - if element.x < min_x: - min_x = element.x - if element.y < min_y: - min_y = element.y - - _element_max_x = element.x + (element.width * element.scale) - _element_max_y = element.y + (element.height * element.scale) - if _element_max_x > max_x: - max_x = _element_max_x - if _element_max_y > max_y: - max_y = _element_max_y - return max_x - min_x, max_y - min_y - - @property - def width(self): - return self.size[0] - - @property - def height(self): - return self.size[1]