Skip to content

Commit 97e3577

Browse files
committed
Added an About Section
1 parent a5d4f1a commit 97e3577

21 files changed

Lines changed: 107 additions & 76 deletions

Package/data_management.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from collections import Counter
22
import os
3-
43
import datetime
4+
55
import openpyxl as op
66
from openpyxl.styles import Font, Alignment
77
from openpyxl.utils import get_column_letter
@@ -389,6 +389,11 @@ def change_color(self) -> None:
389389
self.app.create_achievements()
390390

391391
self.load_notes()
392+
393+
try:
394+
self.app.lock_widgets()
395+
except AttributeError:
396+
pass
392397
print("Color changed.")
393398

394399

@@ -582,11 +587,11 @@ def align_cells(worksheet, cell_range: str):
582587

583588

584589
def create_achievements(self):
585-
self.achievements = [Achievement(name="Time Titan", title="Clock in 1000 minutes of study, mastering the art of time management.", max_value=1000, value=self.total_duration),
590+
self.achievements = [Achievement(name="Time Titan", title="Clock in 5000 minutes of study, mastering the art of time management.", max_value=5000, value=self.total_duration),
586591
Achievement(name="Goal Getter", title="Reach 30 goals, proving dedication to progress.", max_value=30, value=self.goal_amount),
587592
Achievement(name="Subject Explorer", title="Dive into 7 different subjects, broadening your knowledge horizons.", max_value=7, value=len(self.unique_subjects)),
588593
Achievement(name="Focus Maestro", title="Master concentration in a 5-hour session, demonstrating exceptional focus.", max_value=5, value=round(self.longest_session/60, 2)),
589594
Achievement(name="Subject Savant", title="Study one subject 30 times, becoming a savant in its intricacies.", max_value=30, value=self.most_common_subject_amount),
590-
Achievement(name="Restful Respite", title="Accumulate 200 minutes of break time, rejuvenating your mind and body.", max_value=200, value=self.total_break_duration),
595+
Achievement(name="Restful Respite", title="Accumulate 500 minutes of break time, rejuvenating your mind and body.", max_value=500, value=self.total_break_duration),
591596
Achievement(name="Daily Discipline", title="Exhibit discipline through diligent study for 30 days.", max_value=30, value=len(set(self.date_list))),
592597
Achievement(name="Note Scribbler", title="Scribble down 10 notes, capturing key insights and ideas.", max_value=10, value=self.notes_amount)]

Package/note_management.py

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -65,37 +65,22 @@ def _open_notes_text(self, date, title, text, index):
6565
header_frame.grid(row=0, column=0, pady=(0, frame_padding))
6666
header_frame.grid_propagate(False)
6767

68-
def title_text(title: str) -> str:
69-
max_letters = 45
70-
71-
for letter in title:
72-
if letter.isupper():
73-
max_letters -= 0.4
74-
75-
76-
max_letters = int(max_letters)
77-
78-
display_title = title
68+
title_frame = ctk.CTkScrollableFrame(header_frame, fg_color="transparent", bg_color="transparent", orientation="horizontal", height=40, width=WIDTH - 280 - frame_padding * 7)
69+
title_frame.grid(row=0, column=0, padx=widget_padding_x)
7970

80-
if len(title) > max_letters:
81-
display_title = title[:max_letters] + "..."
82-
83-
return display_title
84-
85-
title_label = ctk.CTkLabel(header_frame, text=title_text(title), font=(font_family, font_size*1.5), text_color=(light_font_color, font_color),
86-
height=40, width=WIDTH - 280 - frame_padding * 6, fg_color=(light_frame_color, frame_color), anchor="w")
87-
title_label.grid(row=0, column=0, padx=widget_padding_x, pady=widget_padding_y)
71+
title_label = ctk.CTkLabel(title_frame, text=title, font=(font_family, font_size*1.2), text_color=(light_font_color, font_color), fg_color=(light_frame_color, frame_color), anchor="w")
72+
title_label.pack(pady=(10, 0))
8873

8974
button_frame = ctk.CTkFrame(header_frame, fg_color="transparent")
90-
button_frame.place(anchor="center", rely=0.5, relx=0.825)
75+
button_frame.place(anchor="center", rely=0.5, relx=0.84)
9176

9277
textbox = ctk.CTkTextbox(frame, font=(font_family, font_size), text_color=(light_font_color, font_color), fg_color="transparent", width=WIDTH - frame_padding * 2, height=HEIGHT + frame_padding * 2 - 60)
9378
textbox.grid(row=1, column=0)
9479
textbox.insert("0.0", text)
9580
textbox.configure(state="disabled")
9681

9782
edit_button = ctk.CTkButton(button_frame, height=button_height, text="Edit", fg_color=self.data_manager.color, anchor="center",
98-
hover_color=self.data_manager.highlight_color, font=(font_family, font_size), text_color=button_font_color, command=lambda: self.edit_note(index, textbox, edit_button, frame))
83+
hover_color=self.data_manager.highlight_color, font=(font_family, font_size), text_color=button_font_color, command=lambda: self.edit_note(index, textbox, edit_button, frame, title_label, title_frame))
9984
edit_button.grid(row=0, column=1)
10085
exit_button = ctk.CTkButton(button_frame, height=button_height, text="Exit", fg_color=self.data_manager.color, command=lambda: self._exit_note(frame),
10186
hover_color=self.data_manager.highlight_color, font=(font_family, font_size), text_color=button_font_color, anchor="center")
@@ -107,13 +92,20 @@ def _exit_note(self, frame):
10792
self.app.notes_frame_frame.grid(row=0, column=0, padx=frame_padding, pady=(frame_padding, 0))
10893

10994

110-
def edit_note(self, index, textbox, edit_button, frame):
95+
def edit_note(self, index, textbox, edit_button, frame, title_label, title_frame):
11196
def save_note(index, frame):
97+
self.data_manager.worksheet["O" + str(index)].value = title_entry.get()
11298
self.data_manager.worksheet["P" + str(index)].value = textbox.get("0.0", "end")
11399
self._exit_note(frame)
114100
self.data_manager.workbook.save(self.app.data_file)
101+
self.data_manager.load_notes()
115102

116103
textbox.configure(state="normal", fg_color=(light_frame_color, frame_color))
104+
title_label.update()
105+
title_entry = ctk.CTkEntry(title_frame, fg_color="transparent", font=(font_family, font_size*1.2), bg_color=(light_frame_color, frame_color), text_color=(light_font_color, font_color), width=WIDTH - 280 - frame_padding * 7, height=40)
106+
title_entry.pack(pady=(10, 0))
107+
title_entry.insert(0, title_label.cget("text"))
108+
title_label.pack_forget()
117109
edit_button.configure(command=lambda: save_note(index, frame), text="Save")
118110

119111

icons/back_icon_dark.png

-5.98 KB
Binary file not shown.

icons/back_icon_light.png

-6.63 KB
Binary file not shown.

icons/checkmark_icon_dark.png

-20.9 KB
Binary file not shown.

icons/create_note_icon_dark.png

-9.12 KB
Binary file not shown.

icons/delete_icon_dark.png

-12.9 KB
Binary file not shown.

icons/delete_icon_light.png

-14 KB
Binary file not shown.

icons/edit_icon_dark.png

-29 KB
Binary file not shown.

icons/edit_icon_light.png

-29.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)