feat: adiciona nova ação de confirmação para iniciar nova análise e implementa breadcrumb na interface
This commit is contained in:
@@ -66,6 +66,7 @@ pub enum AcaoModal {
|
||||
ConfirmarExpansaoFaltantes,
|
||||
ConfirmarExclusaoLayout(i64),
|
||||
SobrescreverLayout,
|
||||
ConfirmarNovaAnalise,
|
||||
}
|
||||
|
||||
/// Struct principal da aplicação egui.
|
||||
@@ -274,6 +275,10 @@ impl App {
|
||||
}
|
||||
}
|
||||
AcaoModal::SobrescreverLayout => {} // Handled inline in layouts screen
|
||||
AcaoModal::ConfirmarNovaAnalise => {
|
||||
self.notas_importadas.clear();
|
||||
self.estado = EstadoApp::Importando;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,11 +321,47 @@ impl App {
|
||||
}
|
||||
}
|
||||
|
||||
impl App {
|
||||
/// Renderiza o breadcrumb de etapas no topo (exceto na tela de layouts).
|
||||
pub fn renderizar_breadcrumb(&self, ctx: &Context) {
|
||||
let passo_ativo: usize = match self.tela_atual() {
|
||||
0 | 1 => 1,
|
||||
2 | 4 => 2,
|
||||
3 => 3,
|
||||
_ => return, // GerenciandoLayouts: sem breadcrumb
|
||||
};
|
||||
|
||||
egui::TopBottomPanel::top("breadcrumb").show(ctx, |ui| {
|
||||
ui.add_space(4.0);
|
||||
ui.horizontal(|ui| {
|
||||
for (i, label) in ["① Arquivo", "② Colunas", "③ Resultado"].iter().enumerate() {
|
||||
let n = i + 1;
|
||||
let texto = egui::RichText::new(*label);
|
||||
if n == passo_ativo {
|
||||
ui.label(texto.strong());
|
||||
} else if n < passo_ativo {
|
||||
ui.label(texto);
|
||||
} else {
|
||||
ui.label(texto.weak());
|
||||
}
|
||||
if n < 3 {
|
||||
ui.label(egui::RichText::new(" ›").weak());
|
||||
}
|
||||
}
|
||||
});
|
||||
ui.add_space(4.0);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
impl eframe::App for App {
|
||||
fn update(&mut self, ctx: &Context, _frame: &mut eframe::Frame) {
|
||||
// Sempre renderizar modal por cima de tudo
|
||||
self.renderizar_modal(ctx);
|
||||
|
||||
// Breadcrumb de etapas no topo
|
||||
self.renderizar_breadcrumb(ctx);
|
||||
|
||||
// Determinar qual tela exibir sem borrar self.estado
|
||||
let tela_id = self.tela_atual();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user