Skip to content

Commit 51b15e8

Browse files
committed
Initial v2.0.0 Update
Complete app redesign as it's too big again. Modularizing code more and making it more readable.
1 parent b3b3994 commit 51b15e8

13 files changed

Lines changed: 1087 additions & 19 deletions

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11

2-
__pycache__/styles.cpython-312.pyc
32
test.py
43
*.pyc

Package/data_management.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ def load_notes(self) -> None:
326326
frame.pack(pady=frame_padding)
327327
frame.grid_propagate(False)
328328

329+
def _delete_note(frame):
330+
frame.destroy()
331+
#DELETE NOTE FROM EXCEL
332+
329333
title = ctk.CTkLabel(frame, text=str(self.worksheet["O" + str(i)].value), font=(font_family, font_size*1.25),
330334
text_color=(light_font_color, font_color), anchor="center", height=button_height + frame_padding * 2)
331335
title.grid(row=0, column=0, padx=widget_padding_x)
@@ -340,7 +344,7 @@ def load_notes(self) -> None:
340344
command=lambda: self.app._open_notes_text(str(self.worksheet["N" + str(i)].value), str(self.worksheet["O" + str(i)].value), str(self.worksheet["P" + str(i)].value), i))
341345
open_button.grid(row=0, column=0, padx=widget_padding_x)
342346
delete_button = ctk.CTkButton(button_frame, text="Delete", height=button_height, fg_color=self.color, hover_color=self.highlight_color, font=(font_family, font_size), text_color=button_font_color,
343-
command=lambda: self.app._delete_note(frame))
347+
command=lambda: _delete_note(frame))
344348
delete_button.grid(row=0, column=1)
345349

346350

Package/note_management.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class NotesManager:
2+
pass

main.py

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import matplotlib.pyplot as plt
99
import matplotlib.dates as mdates
1010
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
11-
import customtkinter as ctk
1211
from matplotlib.ticker import MaxNLocator, FuncFormatter
12+
import customtkinter as ctk
1313
from winotify import Notification
1414

1515
from Package import *
@@ -142,41 +142,41 @@ def _tab_frames_gui_setup(self) -> None:
142142
self.timer_tab.pack(pady=tab_padding_y)
143143
self.timer_tab_button = ctk.CTkButton(self.timer_tab, text="Timer", font=(tab_font_family, 22*tab_height/50, tab_font_weight), text_color=(light_font_color, font_color),
144144
fg_color=(light_tab_selected_color, tab_selected_color), width=int(tab_frame_width*0.95), height=int(tab_height*0.8), hover_color=(light_tab_highlight_color, tab_highlight_color),
145-
anchor="w", command=lambda: self.switch_tab("main"))
145+
anchor="w", command=lambda: self.switch_tab("Timer"))
146146
self.timer_tab_button.place(relx=0.5, rely=0.5, anchor="center")
147147

148148
self.statistics_tab = ctk.CTkFrame(self.tab_frame, width=tab_frame_width, height=tab_height*0.8, fg_color=(light_tab_color, tab_color))
149149
self.statistics_tab.pack(pady=tab_padding_y)
150150
self.statistics_tab_button = ctk.CTkButton(self.statistics_tab, text="Statistics", font=(tab_font_family, 22*tab_height/50, tab_font_weight), text_color=(light_font_color, font_color),
151151
fg_color=(light_tab_color, tab_color), width=int(tab_frame_width*0.95), height=int(tab_height*0.8), hover_color=(light_tab_highlight_color, tab_highlight_color),
152-
anchor="w", command=lambda: self.switch_tab("statistics"))
152+
anchor="w", command=lambda: self.switch_tab("Statistics"))
153153
self.statistics_tab_button.place(relx=0.5, rely=0.5, anchor="center")
154154

155155
self.achievements_tab = ctk.CTkFrame(self.tab_frame, width=tab_frame_width, height=tab_height*0.8, fg_color=(light_tab_color, tab_color))
156156
self.achievements_tab.pack(pady=tab_padding_y)
157157
self.achievements_tab_button = ctk.CTkButton(self.achievements_tab, text="Achievements", font=(tab_font_family, 22*tab_height/50, tab_font_weight), text_color=(light_font_color, font_color),
158158
fg_color=(light_tab_color, tab_color), width=int(tab_frame_width*0.95), height=int(tab_height*0.8), hover_color=(light_tab_highlight_color, tab_highlight_color),
159-
anchor="w", command=lambda: self.switch_tab("achievements"))
159+
anchor="w", command=lambda: self.switch_tab("Achievements"))
160160
self.achievements_tab_button.place(relx=0.5, rely=0.5, anchor="center")
161161

162162
self.history_tab = ctk.CTkFrame(self.tab_frame, width=tab_frame_width, height=tab_height*0.8, fg_color=(light_tab_color, tab_color))
163163
self.history_tab.pack(pady=tab_padding_y)
164164
self.history_tab_button = ctk.CTkButton(self.history_tab, text="History", font=(tab_font_family, 22*tab_height/50, tab_font_weight), text_color=(light_font_color, font_color),
165165
fg_color=(light_tab_color, tab_color), width=int(tab_frame_width*0.95), height=int(tab_height*0.8), hover_color=(light_tab_highlight_color, tab_highlight_color),
166-
anchor="w", command=lambda: self.switch_tab("history"))
166+
anchor="w", command=lambda: self.switch_tab("History"))
167167
self.history_tab_button.place(relx=0.5, rely=0.5, anchor="center")
168168

169169
self.notes_tab = ctk.CTkFrame(self.tab_frame, width=tab_frame_width, height=tab_height*0.8, fg_color=(light_tab_color, tab_color))
170170
self.notes_tab.pack(pady=tab_padding_y)
171171
self.notes_tab_button = ctk.CTkButton(self.notes_tab, text="Notes", font=(tab_font_family, 22*tab_height/50, tab_font_weight), text_color=(light_font_color, font_color),
172172
fg_color=(light_tab_color, tab_color), width=int(tab_frame_width*0.95), height=int(tab_height*0.8), hover_color=(light_tab_highlight_color, tab_highlight_color),
173-
anchor="w", command=lambda: self.switch_tab("notes"))
173+
anchor="w", command=lambda: self.switch_tab("Notes"))
174174
self.notes_tab_button.place(relx=0.5, rely=0.5, anchor="center")
175175

176176
self.settings_tab = ctk.CTkFrame(self.tab_frame, width=tab_frame_width, height=tab_height*0.8, fg_color=(light_tab_color, tab_color))
177177
self.settings_tab.place(relx=0.5, rely=1, anchor="s")
178178
self.settings_tab_button = ctk.CTkButton(self.settings_tab, text="Settings", font=(tab_font_family, 22*tab_height/50, tab_font_weight), text_color=(light_font_color, font_color),
179-
fg_color=(light_tab_color, tab_color), width=int(tab_frame_width*0.95), height=int(tab_height*0.8), hover_color=(light_tab_highlight_color, tab_highlight_color), anchor="w", command=lambda: self.switch_tab("settings"))
179+
fg_color=(light_tab_color, tab_color), width=int(tab_frame_width*0.95), height=int(tab_height*0.8), hover_color=(light_tab_highlight_color, tab_highlight_color), anchor="w", command=lambda: self.switch_tab("Settings"))
180180
self.settings_tab_button.place(relx=0.5, rely=0.5, anchor="center")
181181

182182

@@ -545,12 +545,12 @@ def forget_and_propagate(self, list: list) -> None:
545545

546546
def switch_tab(self, tab = str) -> None:
547547
tabs = {
548-
"main": [self.main_frame, self.timer_tab_button],
549-
"statistics": [self.statistics_frame, self.statistics_tab_button],
550-
"settings": [self.settings_frame, self.settings_tab_button],
551-
"achievements": [self.achievements_frame, self.achievements_tab_button],
552-
"history": [self.history_frame, self.history_tab_button],
553-
"notes": [self.notes_frame, self.notes_tab_button]
548+
"Timer": [self.main_frame, self.timer_tab_button],
549+
"Statistics": [self.statistics_frame, self.statistics_tab_button],
550+
"Settings": [self.settings_frame, self.settings_tab_button],
551+
"Achievements": [self.achievements_frame, self.achievements_tab_button],
552+
"History": [self.history_frame, self.history_tab_button],
553+
"Notes": [self.notes_frame, self.notes_tab_button]
554554
}
555555

556556
tab_list = [self.main_frame, self.statistics_frame, self.settings_frame, self.achievements_frame, self.history_frame, self.notes_frame]
@@ -789,10 +789,6 @@ def _exit_note(self, frame):
789789
self.notes_frame_frame.grid(row=0, column=0, padx=frame_padding, pady=(frame_padding, 0))
790790

791791

792-
def _delete_note(self, frame):
793-
frame.configure(fg_color="red")
794-
#DELTE NOTE FROM EXCEL
795-
796792
def clear_notes(self):
797793
for note in self.notes_data_frame.winfo_children():
798794
note.destroy()

v2.0.0/Package/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from .main_manager import MainManager
2+
from .timer_management import TimerManager
3+
from .statistics_management import StatisticsManager
4+
from .data_management import DataManager
5+
#from .note_management import NoteManager
6+
from .styles import *

0 commit comments

Comments
 (0)