diff --git a/Programm/img/icons/analytics_red.png b/Programm/img/icons/analytics_red.png new file mode 100644 index 0000000..a478100 Binary files /dev/null and b/Programm/img/icons/analytics_red.png differ diff --git a/Programm/img/icons/group_red.png b/Programm/img/icons/group_red.png new file mode 100644 index 0000000..be9eda1 Binary files /dev/null and b/Programm/img/icons/group_red.png differ diff --git a/Programm/img/icons/pen_red.png b/Programm/img/icons/pen_red.png new file mode 100644 index 0000000..aedad47 Binary files /dev/null and b/Programm/img/icons/pen_red.png differ diff --git a/Programm/img/icons/table_red.png b/Programm/img/icons/table_red.png new file mode 100644 index 0000000..9315a0a Binary files /dev/null and b/Programm/img/icons/table_red.png differ diff --git a/Programm/main.py b/Programm/main.py index 1bce47f..58ddbfe 100644 --- a/Programm/main.py +++ b/Programm/main.py @@ -58,25 +58,34 @@ class Main_Window(CTk): Image.open("img/icons/table_white.png"), Image.open("img/icons/group_white.png"), Image.open("img/icons/settings_white.png")] + + self.img_red = [Image.open("img/icons/analytics_red.png"), + Image.open("img/icons/pen_red.png"), + Image.open("img/icons/table_red.png"), + Image.open("img/icons/group_red.png")] self.img_logo = CTkImage(dark_image=self.img[0], light_image=self.img[0], size=(100,100)) self.logo = CTkLabel(master=self.sidebar_frame, text="", image=self.img_logo) self.logo.pack(padx=5, pady=20) self.img_dashboard = CTkImage(dark_image=self.img[1], light_image=self.img[1]) + self.img_dashboard_red = CTkImage(dark_image=self.img_red[0], light_image=self.img_red[0]) self.button1 = CTkButton(master=self.sidebar_frame, image=self.img_dashboard, text="Dashboard", fg_color="transparent", font=("Arial Bold", 14), hover_color=contrastColor, anchor="w", command=lambda: self.initiate_window(1)) self.button1.pack(padx=5, pady=5) self.img_edit = CTkImage(dark_image=self.img[2], light_image=self.img[2]) + self.img_edit_red = CTkImage(dark_image=self.img_red[1], light_image=self.img_red[1]) self.button2 = CTkButton(master=self.sidebar_frame, image=self.img_edit, text="Eintragen", fg_color="transparent", font=("Arial Bold", 14), hover_color=contrastColor, anchor="w", command=lambda: self.initiate_window(2)) self.button2.pack(padx=5, pady=5) self.img_table = CTkImage(dark_image=self.img[3], light_image=self.img[3]) + self.img_table_red = CTkImage(dark_image=self.img_red[2], light_image=self.img_red[2]) self.button3 = CTkButton(master=self.sidebar_frame, image=self.img_table, text="Werte", fg_color="transparent", font=("Arial Bold", 14), hover_color=contrastColor, anchor="w", command=lambda: self.initiate_window(3)) self.button3.pack(padx=5, pady=5) self.img_users = CTkImage(dark_image=self.img[4], light_image=self.img[4]) + self.img_users_red = CTkImage(dark_image=self.img_red[3], light_image=self.img_red[3]) self.button4 = CTkButton(master=self.sidebar_frame, image=self.img_users, text="Sportler", fg_color="transparent", font=("Arial Bold", 14), hover_color=contrastColor, anchor="w", command=lambda: self.initiate_window(4)) self.button4.pack(padx=5, pady=5) @@ -95,10 +104,7 @@ class Main_Window(CTk): def initiate_window(self,windowNumber): if(windowNumber!=self.lastWindow): - - buttons = [self.button1,self.button2,self.button3,self.button4] - self.updateButton(buttons[windowNumber-1]) - + self.updateButton(windowNumber) self.clear_frame() if(windowNumber==1): @@ -112,11 +118,15 @@ class Main_Window(CTk): self.lastWindow = windowNumber - def updateButton(self,button): - button.configure(fg_color="#fff", hover_color="#eee",text_color=mainColor) + def updateButton(self,buttonNumber): + buttons = [self.button1,self.button2,self.button3,self.button4] + img = [self.img_dashboard,self.img_edit,self.img_table,self.img_users] + img_red = [self.img_dashboard_red,self.img_edit_red,self.img_table_red,self.img_users_red] + + buttons[buttonNumber-1].configure(fg_color="#fff", hover_color="#eee",text_color=mainColor,image=img_red[buttonNumber-1]) if(self.lastButton != None): - self.lastButton.configure(fg_color="transparent", hover_color=contrastColor, text_color="#fff") - self.lastButton = button + buttons[self.lastButton-1].configure(fg_color="transparent", hover_color=contrastColor, text_color="#fff",image=img[self.lastButton-1]) + self.lastButton = buttonNumber def window_1(self): self.buttonTest = CTkButton(master=self.main_container, text="Dashboard", fg_color=contrastColor, font=("Arial Bold", 14), hover_color=mainColor, anchor="center")