Sidebar erstellt (grundlegender Aufbau wurde aus verlinkter Vorlage entnommen)

main
Ben 2 years ago
parent 5d252c6b1c
commit ed13a6e734

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

@ -0,0 +1,61 @@
from customtkinter import *
from CTkTable import CTkTable
from PIL import Image
# Links
# - Icons: https://www.flaticon.com
# - CustomTkinter: https://customtkinter.tomschimansky.com/
# Referenzen
# - Vorlage: https://github.com/RoyChng/customtkinter-examples/tree/master/Inventory%20Management
mainColor = "#C03F49"
contrastColor = "#8F2F3E"
app = CTk()
height= app.winfo_screenheight()
scale = height/720
downSized = 0.8
app.geometry("%dx%d" % (height*16/9*downSized, height*downSized))
app.configure(bg_color="White",fg_color="White")
set_appearance_mode("light")
set_widget_scaling(scale*downSized)
class Sidebar():
def __init__(self):
self.sidebar_frame = CTkFrame(master=app, fg_color=mainColor, width=176, corner_radius=10,bg_color="White")
self.sidebar_frame.pack(fill=Y,side=LEFT,anchor="w",padx=5, pady=5)
self.logo_img = CTkImage(dark_image=Image.open("img/logo_running.png"), light_image=Image.open("img/logo_running.png"), size=(100,100))
self.logo = CTkLabel(master=self.sidebar_frame, text="", image=self.logo_img)
self.logo.pack(padx=5, pady=20)
self.analytics_img_data = Image.open("img/icons/analytics_white.png")
self.analytics_img = CTkImage(dark_image=self.analytics_img_data, light_image=self.analytics_img_data)
self.button1 = CTkButton(master=self.sidebar_frame, image=self.analytics_img, text="Dashboard", fg_color="transparent", font=("Arial Bold", 14), hover_color=contrastColor, anchor="w")
self.button1.pack(padx=5, pady=5)
self.package_img = CTkImage(dark_image=Image.open("img/icons/pen_white.png"), light_image=Image.open("img/icons/pen_white.png"))
self.button2 = CTkButton(master=self.sidebar_frame, image=self.package_img, text="Eintragen", fg_color="transparent", font=("Arial Bold", 14), hover_color=contrastColor, anchor="w")
self.button2.pack(padx=5, pady=5)
self.img_table = CTkImage(dark_image=Image.open("img/icons/table_white.png"), light_image=Image.open("img/icons/table_white.png"))
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")
self.button3.pack(padx=5, pady=5)
self.img_users = CTkImage(dark_image=Image.open("img/icons/group_white.png"), light_image=Image.open("img/icons/group_white.png"))
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")
self.button4.pack(padx=5, pady=5)
self.img_settings = CTkImage(dark_image=Image.open("img/icons/settings_white.png"), light_image=Image.open("img/icons/settings_white.png"))
self.button5 = CTkButton(master=self.sidebar_frame, image=self.img_settings, text="Einstellungen", fg_color="transparent", font=("Arial Bold", 14), hover_color=contrastColor, anchor="w")
self.button5.pack(padx=10, pady=10,side=BOTTOM)
s = Sidebar()
app.mainloop()
Loading…
Cancel
Save