neue UI Elemente hinzugefügt
This commit is contained in:
parent
5fb4a8dd67
commit
7a1aae3d45
|
@ -1,44 +1,64 @@
|
|||
from typing import Any
|
||||
import customtkinter as ctk
|
||||
class MainFrame(ctk.CTkFrame):
|
||||
|
||||
|
||||
|
||||
class MainFrame(ctk.CTkFrame):
|
||||
def __init__(self, master: Any, **kwargs):
|
||||
super().__init__(master, **kwargs)
|
||||
self.controller = None
|
||||
# Konfiguriere das Hauptframe, um sich zu dehnen
|
||||
# Configure the main frame to stretch
|
||||
self.grid_rowconfigure(0, weight=1)
|
||||
self.grid_columnconfigure(0, weight=1) # Linke Spalte soll sich dehnen
|
||||
self.grid_columnconfigure(1, weight=0) # Mittlere Spalte (Button) soll sich nicht dehnen
|
||||
self.grid_columnconfigure(2, weight=1) # Rechte Spalte soll sich dehnen
|
||||
self.grid_columnconfigure(0, weight=1) # Left column should stretch
|
||||
self.grid_columnconfigure(1, weight=0) # Middle column (button) should not stretch
|
||||
self.grid_columnconfigure(2, weight=1) # Right column should stretch
|
||||
|
||||
# Linkes Frame
|
||||
# Left frame
|
||||
self.frame1 = ctk.CTkFrame(self)
|
||||
self.frame1.grid(row=0, column=0, sticky="nsew", padx=10, pady=10)
|
||||
self.frame1.grid_rowconfigure(2, weight=1) # Lasse die Output-Textbox wachsen
|
||||
self.frame1.grid_columnconfigure(0, weight=1) # Lasse frame1 horizontal wachsen
|
||||
self.frame1.grid_rowconfigure(3, weight=1)
|
||||
self.frame1.grid_columnconfigure(0, weight=1)
|
||||
|
||||
self.entry_url = ctk.CTkEntry(self.frame1, placeholder_text='Enter the article link', height=50)
|
||||
self.entry_url.grid(row=0, column=0, padx=10, pady=10, sticky="ew")
|
||||
self.entry_url.grid(row=0, column=0,columnspan=2, padx=10, pady=10, sticky="ew")
|
||||
|
||||
self.input_textbox = ctk.CTkTextbox(self.frame1, height=150)
|
||||
self.input_textbox.grid(row=1, column=0, columnspan=2, padx=10, pady=10, sticky="nsew")
|
||||
|
||||
self.output_textbox = ctk.CTkTextbox(self.frame1, height=200, state="disabled")
|
||||
self.output_textbox.grid(row=2, column=0, columnspan=2, padx=10, pady=10, sticky="nsew")
|
||||
|
||||
# Mittlerer Button
|
||||
# Middle button
|
||||
self.check_button = ctk.CTkButton(self.frame1, text="Check", width=60, height=50, command=self.check_button_event)
|
||||
self.check_button.grid(row=0, column=1, padx=10, pady=10, sticky="w")
|
||||
self.check_button.grid(row=0, column=2,columnspan=1, padx=10, pady=10, sticky="e")
|
||||
|
||||
# Rechte scrollbare Ansicht
|
||||
# Input Checkbox
|
||||
self.input_textbox = ctk.CTkTextbox(self.frame1, height=125)
|
||||
self.input_textbox.grid(row=1, column=0,columnspan=3, padx=10, pady=10, sticky="nsew")
|
||||
|
||||
# Frame for Result and Confidence labels
|
||||
self.label_frame = ctk.CTkFrame(self.frame1, fg_color="#333333")
|
||||
self.label_frame.grid(row=2, column=0, columnspan=3, padx=10, pady=10, sticky="ew")
|
||||
self.label_frame.grid_columnconfigure(0, weight=1)
|
||||
self.label_frame.grid_columnconfigure(1, weight=1)
|
||||
|
||||
# Result label
|
||||
self.result_label = ctk.CTkLabel(self.label_frame, text="", height=50, fg_color="#333333", corner_radius=5)
|
||||
self.result_label.grid(row=0, column=0, padx=(0, 5), pady=0, sticky="ew")
|
||||
|
||||
# Confidence label
|
||||
self.confidence_label = ctk.CTkLabel(self.label_frame, text="", height=50, fg_color="#333333", corner_radius=5)
|
||||
self.confidence_label.grid(row=0, column=1, padx=(5, 0), pady=0, sticky="ew")
|
||||
|
||||
# Ensure equal width for both labels
|
||||
self.label_frame.grid_columnconfigure(0, weight=1, minsize=200)
|
||||
self.label_frame.grid_columnconfigure(1, weight=1, minsize=200)
|
||||
|
||||
self.output_textbox = ctk.CTkTextbox(self.frame1, height=175, state="disabled")
|
||||
self.output_textbox.grid(row=3, column=0, columnspan=3, padx=10, pady=10, sticky="nsew")
|
||||
|
||||
# Right scrollable view
|
||||
self.scrollview = ctk.CTkScrollableFrame(self)
|
||||
self.scrollview.grid(row=0, column=2, padx=10, pady=10, sticky="nsew")
|
||||
|
||||
# Überschrift hinzufügen
|
||||
# Add header
|
||||
self.header = ctk.CTkLabel(self.scrollview, text="Leaderboard", font=("Arial", 24, "bold"))
|
||||
self.header.pack(pady=10, padx=10, anchor="w")
|
||||
|
||||
# Container für Provider-Einträge
|
||||
# Container for provider entries
|
||||
self.provider_container = ctk.CTkFrame(self.scrollview)
|
||||
self.provider_container.pack(fill="both", expand=True)
|
||||
|
||||
|
|
Loading…
Reference in New Issue