@@ -47,6 +47,7 @@ def create_gui(self):
4747 self ._subject_gui_setup ()
4848 self ._pomodoro_gui_setup ()
4949 self ._history_gui_setup ()
50+ self ._notes_gui_setup ()
5051 self ._settings_gui_setup ()
5152
5253
@@ -126,7 +127,10 @@ def _main_frame_gui_setup(self) -> None:
126127 self .history_frame = ctk .CTkFrame (self .WINDOW , fg_color = main_frame_color , height = HEIGHT + ((widget_padding_x + frame_padding )* 2 ), width = WIDTH , corner_radius = 0 )
127128 self .history_frame .grid (column = 2 , row = 0 , padx = main_frame_pad_x )
128129
129- self .forget_and_propagate ([self .statistics_frame , self .settings_frame , self .achievements_frame , self .history_frame ])
130+ self .notes_frame = ctk .CTkFrame (self .WINDOW , fg_color = main_frame_color , height = HEIGHT + ((widget_padding_x + frame_padding )* 2 ), width = WIDTH , corner_radius = 0 )
131+ self .notes_frame .grid (column = 2 , row = 0 , padx = main_frame_pad_x )
132+
133+ self .forget_and_propagate ([self .statistics_frame , self .settings_frame , self .achievements_frame , self .history_frame , self .notes_frame ])
130134
131135
132136 def _tab_frames_gui_setup (self ) -> None :
@@ -158,6 +162,13 @@ def _tab_frames_gui_setup(self) -> None:
158162 anchor = "w" , command = lambda : self .switch_tab ("history" ))
159163 self .history_tab_button .place (relx = 0.5 , rely = 0.5 , anchor = "center" )
160164
165+ self .notes_tab = ctk .CTkFrame (self .tab_frame , width = tab_frame_width , height = tab_height * 0.8 , fg_color = tab_color )
166+ self .notes_tab .pack (pady = tab_padding_y )
167+ self .notes_tab_button = ctk .CTkButton (self .notes_tab , text = "Notes" , font = (tab_font_family , 22 * tab_height / 50 , tab_font_weight ), text_color = font_color ,
168+ fg_color = tab_color , width = int (tab_frame_width * 0.95 ), height = int (tab_height * 0.8 ), hover_color = tab_highlight_color ,
169+ anchor = "w" , command = lambda : self .switch_tab ("notes" ))
170+ self .notes_tab_button .place (relx = 0.5 , rely = 0.5 , anchor = "center" )
171+
161172 self .settings_tab = ctk .CTkFrame (self .tab_frame , width = tab_frame_width , height = tab_height * 0.8 , fg_color = tab_color )
162173 self .settings_tab .place (relx = 0.5 , rely = 1 , anchor = "s" )
163174 self .settings_tab_button = ctk .CTkButton (self .settings_tab , text = "Settings" , font = (tab_font_family , 22 * tab_height / 50 , tab_font_weight ), text_color = font_color ,
@@ -274,7 +285,7 @@ def _history_gui_setup(self) -> None:
274285 history_frame_frame .grid (row = 0 , column = 0 , padx = frame_padding , pady = (frame_padding , 0 ))
275286 history_frame_frame .pack_propagate (False )
276287
277- history_label_frame = ctk .CTkFrame (history_frame_frame , fg_color = "transparent" , width = WIDTH - (frame_padding * 4 ), height = 35 )
288+ history_label_frame = ctk .CTkFrame (history_frame_frame , fg_color = frame_color , width = WIDTH - (frame_padding * 4 ), height = 35 )
278289 history_label_frame .pack (pady = (frame_padding , 0 ))
279290 history_label_frame .grid_propagate (False )
280291
@@ -381,6 +392,35 @@ def _pomodoro_gui_setup(self) -> None:
381392 pomodoro_button .place (anchor = "s" , relx = 0.5 , rely = 0.9 )
382393
383394
395+ def _notes_gui_setup (self ) -> None :
396+ self .notes_frame_frame = ctk .CTkFrame (self .notes_frame , fg_color = frame_color , corner_radius = 10 , height = (HEIGHT + ((widget_padding_x )* 2 )), width = WIDTH - frame_padding * 2 )
397+ self .notes_frame_frame .grid (row = 0 , column = 0 , padx = frame_padding , pady = (frame_padding , 0 ))
398+ self .notes_frame_frame .pack_propagate (False )
399+
400+ new_note_frame = ctk .CTkFrame (self .notes_frame_frame , fg_color = frame_color , width = WIDTH - (frame_padding * 4 ), height = 35 )
401+ new_note_frame .pack (pady = (frame_padding , 0 ))
402+ new_note_frame .grid_propagate (False )
403+
404+ notes_data_frame = ctk .CTkScrollableFrame (self .notes_frame_frame , fg_color = "transparent" , width = WIDTH - (frame_padding * 4 ), height = 520 + frame_padding * 2 )
405+ notes_data_frame .pack (padx = frame_padding )
406+
407+ new_note_button = ctk .CTkButton (new_note_frame , text = "New note" , font = (font_family , font_size ), text_color = button_font_color , fg_color = button_color , hover_color = button_highlight_color ,
408+ height = button_height , command = self .create_new_note )
409+ new_note_button .grid ()
410+
411+
412+ def _new_note_gui_setup (self ):
413+ self .note_creation_frame = ctk .CTkFrame (self .notes_frame , fg_color = frame_color , corner_radius = 10 , height = HEIGHT + frame_padding * 2 , width = WIDTH - frame_padding * 2 )
414+ self .note_creation_frame .grid (padx = frame_padding , pady = frame_padding )
415+ self .note_creation_frame .grid_propagate (False )
416+ self .notes_title_entry = ctk .CTkEntry (self .note_creation_frame , placeholder_text = "Title" , font = (font_family , font_size ), text_color = font_color ,
417+ border_color = frame_border_color , height = 40 , width = 200 , fg_color = frame_color )
418+ self .notes_title_entry .grid (row = 0 , column = 0 , padx = widget_padding_x , pady = widget_padding_y )
419+ self .notes_text_entry = ctk .CTkTextbox (self .note_creation_frame , font = (font_family , font_size ), text_color = font_color ,
420+ border_color = frame_border_color , height = 40 , width = 500 , fg_color = frame_color , border_width = 2 , bg_color = "black" )
421+ self .notes_text_entry .grid (row = 1 , column = 0 , padx = widget_padding_x , pady = widget_padding_y )
422+
423+
384424 def create_time_spent_graph (self ) -> None :
385425 data = {"Date" : self .data_manager .date_list , "Duration" : self .data_manager .duration_list }
386426 df = pd .DataFrame (data )
@@ -469,10 +509,11 @@ def switch_tab(self, tab = str) -> None:
469509 "statistics" : [self .statistics_frame , self .statistics_tab_button ],
470510 "settings" : [self .settings_frame , self .settings_tab_button ],
471511 "achievements" : [self .achievements_frame , self .achievements_tab_button ],
472- "history" : [self .history_frame , self .history_tab_button ]
512+ "history" : [self .history_frame , self .history_tab_button ],
513+ "notes" : [self .notes_frame , self .notes_tab_button ]
473514 }
474515
475- tab_list = [self .main_frame , self .statistics_frame , self .settings_frame , self .achievements_frame , self .history_frame ]
516+ tab_list = [self .main_frame , self .statistics_frame , self .settings_frame , self .achievements_frame , self .history_frame , self . notes_frame ]
476517 tab_list .remove (tabs [tab ][0 ])
477518
478519 def _forget_tabs ():
@@ -484,7 +525,7 @@ def _forget_tabs():
484525 tabs [tab ][0 ].grid (column = 2 , row = 0 , padx = main_frame_pad_x )
485526 tabs [tab ][0 ].grid_propagate (False )
486527
487- tab_button_list = [self .timer_tab_button , self .statistics_tab_button , self .settings_tab_button , self .achievements_tab_button , self .history_tab_button ]
528+ tab_button_list = [self .timer_tab_button , self .statistics_tab_button , self .settings_tab_button , self .achievements_tab_button , self .history_tab_button , self . notes_tab_button ]
488529 tab_button_list .remove (tabs [tab ][1 ])
489530
490531 def _decolor_tabs ():
@@ -647,6 +688,12 @@ def load_history(self):
647688 self .break_text .configure (text = break_history )
648689 self .subject_text .configure (text = subject_history )
649690
691+
692+ def create_new_note (self ):
693+ self .notes_frame_frame .grid_forget ()
694+
695+ self ._new_note_gui_setup ()
696+
650697
651698 def send_notification (self , title , message ) -> None :
652699 toast = Notification (app_id = self .APPNAME , title = title , msg = message )
0 commit comments