|
9 | 9 | class IconManager: |
10 | 10 | def __init__(self, icon_assets_path): |
11 | 11 | self.icon_assets_path = icon_assets_path |
12 | | - assert os.path.isdir(self.icon_assets_path), "Unable to find icon assets" |
13 | 12 |
|
14 | | - self.copy_icon = self.load_ctk_image(os.path.join(icon_assets_path, "copy_icon.png")) |
15 | | - self.export_icon = self.load_ctk_image(os.path.join(icon_assets_path, "export_icon.png")) |
16 | | - self.folder_icon = self.load_ctk_image(os.path.join(icon_assets_path, "folder_icon.png")) |
17 | | - self.restore_icon = self.load_ctk_image(os.path.join(icon_assets_path, "restore_icon.png")) |
18 | | - self.settings_icon = self.load_ctk_image(os.path.join(icon_assets_path, "settings_icon.png")) |
| 13 | + self.copy_icon = self.load_ctk_image("copy_icon.png") |
| 14 | + self.export_icon = self.load_ctk_image("export_icon.png") |
| 15 | + self.folder_icon = self.load_ctk_image("folder_icon.png") |
| 16 | + self.restore_icon = self.load_ctk_image("restore_icon.png") |
| 17 | + self.settings_icon = self.load_ctk_image("settings_icon.png") |
| 18 | + self.filter_icon = self.load_ctk_image("filter_icon.png") |
| 19 | + self.search_icon = self.load_ctk_image("search_icon.png") |
| 20 | + |
| 21 | + def load_ctk_image(self, image_name: str) -> customtkinter.CTkImage: |
| 22 | + image_path = os.path.join(self.icon_assets_path, image_name) |
| 23 | + assert os.path.isfile(image_path), "Unable to find icon assets" |
19 | 24 |
|
20 | | - @staticmethod |
21 | | - def load_ctk_image(image_path: str) -> customtkinter.CTkImage: |
22 | 25 | return customtkinter.CTkImage(PIL.Image.open(image_path)) |
0 commit comments