Interface init
This commit is contained in:
parent
e330ab548c
commit
987c128917
2
main.py
2
main.py
|
@ -1,4 +1,4 @@
|
||||||
from visao.interface_texto import InterfaceTexto
|
# from visao.interface_texto import InterfaceTexto
|
||||||
from visao.interface_gui import InterfaceGUI
|
from visao.interface_gui import InterfaceGUI
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -88,14 +88,38 @@ class HomePage(tk.Frame):
|
||||||
super().__init__(parent, bg="#1e1e1e")
|
super().__init__(parent, bg="#1e1e1e")
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
|
|
||||||
# Configura o grid principal da HomePage para ter 2 colunas
|
# Configura o grid principal da HomePage para ter 2 colunas e 2 linhas
|
||||||
self.grid_columnconfigure(0, weight=2) # Coluna da esquerda (cards)
|
self.grid_columnconfigure(0, weight=2) # Coluna da esquerda (cards)
|
||||||
self.grid_columnconfigure(1, weight=1) # Coluna da direita (configurações)
|
self.grid_columnconfigure(1, weight=1) # Coluna da direita (configurações)
|
||||||
self.grid_rowconfigure(0, weight=1)
|
self.grid_rowconfigure(0, weight=0) # Linha para o header (não expande)
|
||||||
|
self.grid_rowconfigure(1, weight=1) # Linha para o conteúdo principal (expande)
|
||||||
|
|
||||||
|
# --- Header com ícone e título ---
|
||||||
|
header_frame = tk.Frame(self, bg="#1e1e1e")
|
||||||
|
# Coloca o header na primeira linha, ocupando as duas colunas
|
||||||
|
header_frame.grid(row=0, column=0, columnspan=2, sticky="ew", padx=20, pady=(20, 0))
|
||||||
|
|
||||||
|
home_icon = tk.Label(
|
||||||
|
header_frame,
|
||||||
|
text="🏠", # Ícone de casa
|
||||||
|
font=controller.title_font,
|
||||||
|
fg="white",
|
||||||
|
bg="#1e1e1e"
|
||||||
|
)
|
||||||
|
home_icon.pack(side="left", anchor="w")
|
||||||
|
|
||||||
|
home_label = tk.Label(
|
||||||
|
header_frame,
|
||||||
|
text="Home",
|
||||||
|
font=controller.title_font,
|
||||||
|
fg="white",
|
||||||
|
bg="#1e1e1e"
|
||||||
|
)
|
||||||
|
home_label.pack(side="left", padx=10, anchor="w")
|
||||||
|
|
||||||
# --- Frame da Esquerda para os ActionCards ---
|
# --- Frame da Esquerda para os ActionCards ---
|
||||||
left_frame = tk.Frame(self, bg="#1e1e1e")
|
left_frame = tk.Frame(self, bg="#1e1e1e")
|
||||||
left_frame.grid(row=0, column=0, sticky="nsew", padx=20, pady=20)
|
left_frame.grid(row=1, column=0, sticky="nsew", padx=20, pady=20)
|
||||||
|
|
||||||
# Configura um grid dentro do frame da esquerda para os cards
|
# Configura um grid dentro do frame da esquerda para os cards
|
||||||
left_frame.grid_columnconfigure((0, 1), weight=1)
|
left_frame.grid_columnconfigure((0, 1), weight=1)
|
||||||
|
@ -103,7 +127,7 @@ class HomePage(tk.Frame):
|
||||||
|
|
||||||
# --- Frame da Direita para Controles e Botão ---
|
# --- Frame da Direita para Controles e Botão ---
|
||||||
right_frame = tk.Frame(self, bg="#1e1e1e")
|
right_frame = tk.Frame(self, bg="#1e1e1e")
|
||||||
right_frame.grid(row=0, column=1, sticky="nsew", padx=20, pady=20)
|
right_frame.grid(row=1, column=1, sticky="nsew", padx=20, pady=20)
|
||||||
right_frame.grid_columnconfigure(0, weight=1)
|
right_frame.grid_columnconfigure(0, weight=1)
|
||||||
# As rows do frame da direita não precisam expandir, então não configuramos rowconfigure
|
# As rows do frame da direita não precisam expandir, então não configuramos rowconfigure
|
||||||
|
|
||||||
|
@ -128,37 +152,6 @@ class HomePage(tk.Frame):
|
||||||
|
|
||||||
# --- Criando os widgets no FRAME DA DIREITA ---
|
# --- Criando os widgets no FRAME DA DIREITA ---
|
||||||
|
|
||||||
# Frame para "Configurações"
|
|
||||||
settings_frame = tk.LabelFrame(
|
|
||||||
right_frame,
|
|
||||||
text="Configurações Gerais",
|
|
||||||
font=controller.title_font,
|
|
||||||
bg="#2d2d2d",
|
|
||||||
fg="white",
|
|
||||||
padx=15,
|
|
||||||
pady=15
|
|
||||||
)
|
|
||||||
settings_frame.pack(fill="x", expand=False, pady=(0, 20)) # pady adiciona espaço abaixo
|
|
||||||
|
|
||||||
tk.Label(settings_frame, text="Nome do Relatório:", font=controller.label_font, bg="#2d2d2d", fg="white").pack(anchor="w")
|
|
||||||
tk.Entry(settings_frame, bg="#4a4a4a", fg="white", insertbackground="white", relief="flat").pack(fill="x", pady=(2, 10))
|
|
||||||
|
|
||||||
tk.Label(settings_frame, text="Salvar em:", font=controller.label_font, bg="#2d2d2d", fg="white").pack(anchor="w")
|
|
||||||
tk.Entry(settings_frame, bg="#4a4a4a", fg="white", insertbackground="white", relief="flat").pack(fill="x", pady=(2, 10))
|
|
||||||
|
|
||||||
# Botão START
|
|
||||||
start_button = tk.Button(
|
|
||||||
right_frame,
|
|
||||||
text="INICIAR",
|
|
||||||
font=controller.title_font,
|
|
||||||
bg="#6be2e8", # Azul-ciano da imagem
|
|
||||||
fg="#1e1e1e", # Texto escuro para contraste
|
|
||||||
activebackground="#88f0f8",
|
|
||||||
relief="flat",
|
|
||||||
pady=10
|
|
||||||
)
|
|
||||||
start_button.pack(fill="x", side="bottom")
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app = InterfaceGUI()
|
app = InterfaceGUI()
|
||||||
|
|
Loading…
Reference in New Issue