Skip to content

Commit 05b8938

Browse files
theme
1 parent 1d213bb commit 05b8938

2 files changed

Lines changed: 2 additions & 129 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: |
2323
python -m pip install --upgrade pip
2424
pip install -r requirements.txt
25-
pip install pyinstaller
25+
pip install pyinstaller pandas reportlab
2626
2727
- name: ⚙️ Compilar o sistema
2828
run: |

tela.py

Lines changed: 1 addition & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from gerenciador_excecoes import gerenciador_excecoes, TipoErro, GerenciadorExcecoes # import exception handler
1919
from utilidades_ui import GerenciadorResponsividade, UtiliadadesGraficos # import UI utilities
2020
from lugar_geometrico_raizes import AnalisadorLGR, ErroValidacaoLGR
21-
from tema_config import GerenciadorTemas, gerenciador_temas, obter_caminho_recurso # Importar função para obter caminho de recursos
21+
from tema_config import GerenciadorTemas, gerenciador_temas, obter_caminho_recurso
2222

2323
CORES = gerenciador_temas.obter_cores()
2424

@@ -27,133 +27,6 @@
2727
ctk.set_default_color_theme("blue")
2828

2929

30-
class GerenciadorTemas:
31-
"""Gerencia temas claro e escuro com persistência"""
32-
33-
TEMAS = {
34-
"dark": {
35-
"mode": "dark",
36-
"primaria": "#1a4d8f",
37-
"primaria_hover": "#144173",
38-
"secundaria": "#2e7d32",
39-
"secundaria_hover": "#1e5021",
40-
"terciaria": "#c62828",
41-
"terciaria_hover": "#8e0000",
42-
"quarto": "#9333ea",
43-
"quarto_hover": "#7e22ce",
44-
"fundo_escuro": "#1a1a2e",
45-
"fundo_claro": "#16213e",
46-
"texto_principal": "#fcfcfc",
47-
"texto_secundario": "#f9f9f9",
48-
"acento": "#0f3460",
49-
"borda": "#2d3748",
50-
"sucesso": "#059669",
51-
"alerta": "#d97706",
52-
"erro": "#dc2626"
53-
},
54-
"light": {
55-
"mode": "light",
56-
"primaria": "#2563eb",
57-
"primaria_hover": "#1d4ed8",
58-
"secundaria": "#1e5021",
59-
"secundaria_hover": "#15803d",
60-
"terciaria": "#dc2626",
61-
"terciaria_hover": "#b91c1c",
62-
"quarto": "#9333ea",
63-
"quarto_hover": "#7e22ce",
64-
"fundo_escuro": "#f8fafc",
65-
"fundo_claro": "#ffffff",
66-
"texto_principal": "#000000",
67-
"texto_secundario": "#313335",
68-
"acento": "#e2e8f0",
69-
"borda": "#cbd5e1",
70-
"sucesso": "#10b981",
71-
"alerta": "#f59e0b",
72-
"erro": "#ef4444"
73-
},
74-
"high_contrast": {
75-
"mode": "dark",
76-
"primaria": "#0066ff",
77-
"primaria_hover": "#0052cc",
78-
"secundaria": "#00ff00",
79-
"secundaria_hover": "#00cc00",
80-
"terciaria": "#ff0000",
81-
"terciaria_hover": "#cc0000",
82-
"quarto": "#9333ea",
83-
"quarto_hover": "#7e22ce",
84-
"fundo_escuro": "#000000",
85-
"fundo_claro": "#1a1a1a",
86-
"texto_principal": "#ffffff",
87-
"texto_secundario": "#ffff00",
88-
"acento": "#333333",
89-
"borda": "#ffffff",
90-
"sucesso": "#00ff00",
91-
"alerta": "#ffff00",
92-
"erro": "#ff0000"
93-
}
94-
}
95-
96-
def __init__(self):
97-
self.tema_atual = "dark"
98-
self.config_file = obter_caminho_recurso("config_tema.json") # Usar função para obter caminho
99-
self.carregar_configuracao()
100-
101-
def carregar_configuracao(self):
102-
"""Carrega configuração salva"""
103-
try:
104-
if os.path.exists(self.config_file):
105-
with open(self.config_file, 'r') as f:
106-
config = json.load(f)
107-
self.tema_atual = config.get('tema', 'dark')
108-
except:
109-
self.tema_atual = "dark"
110-
111-
def salvar_configuracao(self):
112-
"""Salva configuração atual"""
113-
try:
114-
with open(self.config_file, 'w') as f:
115-
json.dump({'tema': self.tema_atual}, f)
116-
except:
117-
pass
118-
119-
def alternar_tema(self):
120-
"""Alterna entre temas"""
121-
temas_disponiveis = list(self.TEMAS.keys())
122-
idx_atual = temas_disponiveis.index(self.tema_atual)
123-
idx_proximo = (idx_atual + 1) % len(temas_disponiveis)
124-
self.tema_atual = temas_disponiveis[idx_proximo]
125-
self.salvar_configuracao()
126-
return self.tema_atual
127-
128-
def definir_tema(self, nome_tema):
129-
"""Define um tema específico"""
130-
if nome_tema in self.TEMAS:
131-
self.tema_atual = nome_tema
132-
self.salvar_configuracao()
133-
return True
134-
return False
135-
136-
def obter_cores(self):
137-
"""Retorna as cores do tema atual"""
138-
return self.TEMAS[self.tema_atual]
139-
140-
def obter_nome_tema(self):
141-
"""Retorna nome amigável do tema"""
142-
nomes = {
143-
"dark": "Escuro",
144-
"light": "Claro",
145-
"high_contrast": "Alto Contraste"
146-
}
147-
return nomes.get(self.tema_atual, "Escuro")
148-
149-
gerenciador_temas = GerenciadorTemas()
150-
CORES = gerenciador_temas.obter_cores()
151-
152-
# Configuração do tema inicial
153-
ctk.set_appearance_mode(CORES["mode"])
154-
ctk.set_default_color_theme("blue")
155-
156-
15730
class GerenciadorExcecoes:
15831
"""Novo sistema centralizado de tratamento de exceções"""
15932

0 commit comments

Comments
 (0)