Skip to content

Commit

Permalink
Add icon
Browse files Browse the repository at this point in the history
  • Loading branch information
jake158 committed May 7, 2024
1 parent 5ba2e86 commit a1fa6ef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
9 changes: 7 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -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()


Expand Down
7 changes: 6 additions & 1 deletion src/app.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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')
Binary file added src/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a1fa6ef

Please sign in to comment.