From a1fa6ef3365e1393822ca0001b4aca0b409eb553 Mon Sep 17 00:00:00 2001 From: freeram Date: Tue, 7 May 2024 16:02:20 -0600 Subject: [PATCH] Add icon --- main.py | 9 +++++++-- src/app.py | 7 ++++++- src/assets/icon.png | Bin 0 -> 1810 bytes 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 src/assets/icon.png diff --git a/main.py b/main.py index a05a673..f97eb87 100644 --- a/main.py +++ b/main.py @@ -1,13 +1,18 @@ +import os import customtkinter as ctk from src.app import PomodoroApp from src.utils import load_config, THEMES_DIR +data_dir = os.path.dirname(__file__) + + def main(): config = load_config() - ctk.set_default_color_theme(f"{THEMES_DIR}/{config['theme']}.json") + ctk.set_default_color_theme(os.path.join(data_dir, THEMES_DIR, f"{config['theme']}.json")) ctk.set_appearance_mode("dark") - app = PomodoroApp() + icon_path = os.path.join(data_dir, 'src', 'assets', 'icon.png') + app = PomodoroApp(icon_path) app.mainloop() diff --git a/src/app.py b/src/app.py index 9ca1abd..fee7edf 100644 --- a/src/app.py +++ b/src/app.py @@ -1,4 +1,5 @@ import customtkinter as ctk +from PIL.ImageTk import PhotoImage from src.frames.pomodoro_frame import PomodoroFrame from src.frames.settings_frame import SettingsFrame from src.frames.stats_frame import StatsFrame @@ -34,11 +35,15 @@ class PomodoroApp(ctk.CTk): WIDTH = 350 HEIGHT = 450 - def __init__(self): + def __init__(self, icon_path): super().__init__() self.title("Pomodoro Tracker") self.geometry(f"{PomodoroApp.WIDTH}x{PomodoroApp.HEIGHT}") self.resizable(False, True) + img = PhotoImage(file=icon_path) + self.wm_iconbitmap() + self.wm_iconphoto(False, img) + self.tabview = TabView(master=self) self.tabview.pack(pady=(15, 30), expand=True, fill='y') diff --git a/src/assets/icon.png b/src/assets/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..2758bcd8d8f440bc19b823d17fb6740eb57cd990 GIT binary patch literal 1810 zcmV+t2krQYP)0hU$QT92 zMv_)jJ2p00W2k*Nwc|{+$xJ7iG1DYt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