Skip to content

Commit f1f8dd2

Browse files
committed
Added more icons
1 parent fed33e6 commit f1f8dd2

12 files changed

Lines changed: 112 additions & 41 deletions

Package/data_management.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from openpyxl.styles import Font
33

44
import customtkinter as ctk
5+
import darkdetect
56

67
from .styles import *
78
from .note_management import NotesManager
@@ -35,7 +36,10 @@ def initialize_new_file_variables(self) -> None:
3536
self.notes_amount = 0
3637
self.monday_duration = self.tuesday_duration = self.wednesday_duration = self.thursday_duration = self.friday_duration = self.saturday_duration = self.sunday_duration = 0
3738
self.color_name = "Orange"
38-
self.theme_name = "Dark"
39+
if darkdetect.isDark():
40+
self.theme_name = "Dark"
41+
else:
42+
self.theme_name = "Light"
3943

4044
self.customize_excel()
4145
self.save_color()
@@ -116,6 +120,8 @@ def customize_excel(self) -> None:
116120
self.worksheet["O12"].value = "Title:"
117121
self.worksheet["P12"].value = "Text:"
118122

123+
self.worksheet["P1"].value = "Autobreak:"
124+
119125
self.worksheet["Q1"].value = "Eye care:"
120126
self.worksheet["Q4"].value = "Only when timer running:"
121127

@@ -233,6 +239,12 @@ def save_weekday_data(self) -> None:
233239
self.worksheet["W8"].value = self.sunday_duration
234240

235241

242+
def save_autobreak(self, frequency: str, duration: str) -> None:
243+
frequency = int(frequency)
244+
duration = int(duration)
245+
print(frequency, duration)
246+
247+
236248
def set_color(self, color_dropdown) -> None:
237249
self.color_name = color_dropdown.get()
238250
print("Color set.")

Package/note_management.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def create_task(self, index):
1313
self.frame.grid_propagate(False)
1414

1515
def title_text(title: str) -> str:
16-
max_letters = 20
16+
max_letters = 50
1717

1818
display_title = title
1919

@@ -27,16 +27,16 @@ def title_text(title: str) -> str:
2727
title.grid(row=0, column=0, padx=widget_padding_x)
2828
date = ctk.CTkLabel(self.frame, text=str(self.data_manager.worksheet["N" + str(index)].value), font=(font_family, font_size*1.25),
2929
text_color=(light_font_color, font_color), anchor="center", height=button_height + frame_padding * 2)
30-
date.grid(row=0, column=1, padx=widget_padding_x)
30+
date.place(anchor="center", relx=0.75, rely=0.5)
3131

3232
button_frame = ctk.CTkFrame(self.frame, fg_color="transparent")
33-
button_frame.place(anchor="center", rely=0.5, relx=0.825)
33+
button_frame.place(anchor="center", rely=0.5, relx=0.925)
3434

35-
open_button = ctk.CTkButton(button_frame, text="Open", height=button_height, fg_color=self.data_manager.color, hover_color=self.data_manager.highlight_color, font=(font_family, font_size), text_color=button_font_color,
35+
open_button = ctk.CTkButton(button_frame, image=self.app.open_icon, text="", height=button_height, fg_color=self.data_manager.color, hover_color=self.data_manager.highlight_color, font=(font_family, font_size), text_color=button_font_color, width=button_height,
3636
command=lambda: self._open_notes_text(str(self.data_manager.worksheet["N" + str(index)].value), str(self.data_manager.worksheet["O" + str(index)].value), str(self.data_manager.worksheet["P" + str(index)].value), index))
3737
open_button.grid(row=0, column=0, padx=widget_padding_x)
38-
delete_button = ctk.CTkButton(button_frame, text="Delete", height=button_height, fg_color=self.data_manager.color, hover_color=self.data_manager.highlight_color, font=(font_family, font_size), text_color=button_font_color,
39-
command=lambda: self.delete_task(index))
38+
delete_button = ctk.CTkButton(button_frame, image=self.app.delete_icon, text="", height=button_height, fg_color=self.data_manager.color, hover_color=self.data_manager.highlight_color, font=(font_family, font_size), text_color=button_font_color,
39+
command=lambda: self.delete_task(index), width=button_height)
4040
delete_button.grid(row=0, column=1)
4141

4242

@@ -65,18 +65,18 @@ def _open_notes_text(self, date, title, text, index):
6565
#date_label.grid(row=0, column=0, padx=widget_padding_x, pady=widget_padding_y)
6666

6767
button_frame = ctk.CTkFrame(header_frame, fg_color="transparent")
68-
button_frame.place(anchor="center", rely=0.5, relx=0.85)
68+
button_frame.place(anchor="center", rely=0.5, relx=0.95)
6969

7070
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)
7171
textbox.grid(row=1, column=0)
7272
textbox.insert("0.0", text)
7373
textbox.configure(state="disabled")
7474

75-
edit_button = ctk.CTkButton(button_frame, height=button_height, text="Edit", fg_color=self.data_manager.color,
75+
edit_button = ctk.CTkButton(button_frame, height=button_height, image=self.app.edit_icon, text="", fg_color=self.data_manager.color, width=button_height,
7676
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))
7777
edit_button.grid(row=0, column=1)
78-
exit_button = ctk.CTkButton(button_frame, height=button_height, text="Exit", fg_color=self.data_manager.color, command=lambda: self._exit_note(frame),
79-
hover_color=self.data_manager.highlight_color, font=(font_family, font_size), text_color=button_font_color)
78+
exit_button = ctk.CTkButton(button_frame, height=button_height, image=self.app.back_icon, text="", fg_color=self.data_manager.color, command=lambda: self._exit_note(frame),
79+
hover_color=self.data_manager.highlight_color, font=(font_family, font_size), text_color=button_font_color, width=button_height)
8080
exit_button.grid(row=0, column=2, padx=widget_padding_x, pady=widget_padding_y)
8181

8282

@@ -92,7 +92,7 @@ def save_note(index, frame):
9292
self.data_manager.workbook.save(self.app.data_file)
9393

9494
textbox.configure(state="normal", fg_color=(light_frame_color, frame_color))
95-
edit_button.configure(text="Save", command=lambda: save_note(index, frame))
95+
edit_button.configure(text="", image=self.app.save_icon, command=lambda: save_note(index, frame), width=button_height)
9696

9797

9898
def clear_notes(self):

Package/styles.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@
3737

3838
tab_frame_width = 200
3939
tab_font_weight = "normal"
40-
tab_font_family = "Calibri"
41-
tab_padding_y = 0
40+
tab_font_family = font_family
41+
tab_font_size = 16
42+
tab_padding_y = 2
4243

4344
tab_frame_color = "#222222"
4445
light_tab_frame_color = "#dedede"
@@ -100,5 +101,5 @@
100101
pink_pie_colors = ["#f263d5", "#ea6cd1", "#e274cc", "#d97dc7", "#d185c2", "#c88dbd", "#c096b8"]
101102

102103

103-
image_width = 30
104-
image_height = 30
104+
icon_size = 24
105+
tab_icon_size = 20

icons/back_icon_dark.png

5.98 KB
Loading

icons/back_icon_light.png

6.63 KB
Loading

icons/delete_icon_dark.png

12.9 KB
Loading

icons/delete_icon_light.png

14 KB
Loading

icons/edit_icon_dark.png

29 KB
Loading

icons/edit_icon_light.png

29.8 KB
Loading

icons/open_icon_dark.png

8.6 KB
Loading

0 commit comments

Comments
 (0)