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 0000000..2758bcd Binary files /dev/null and b/src/assets/icon.png differ