feat: ajusta rótulo do botão de lote para remover ícone e melhorar legibilidade

This commit is contained in:
2026-02-28 20:40:04 -03:00
parent 121e919bbf
commit d69ce92e32
2 changed files with 86 additions and 74 deletions
+1 -1
View File
@@ -478,7 +478,7 @@ impl eframe::App for App {
egui::TopBottomPanel::top("tab_bar").show(ctx, |ui| {
ui.horizontal(|ui| {
ui.selectable_value(&mut self.active_tab, ActiveTab::Single, "Projeto Único");
ui.selectable_value(&mut self.active_tab, ActiveTab::Batch, "🗂 Lote");
ui.selectable_value(&mut self.active_tab, ActiveTab::Batch, "Lote");
});
});
+85 -73
View File
@@ -181,59 +181,67 @@ impl BatchPanel {
.and_then(|n| n.to_str())
.unwrap_or("");
ui.group(|ui| {
ui.horizontal(|ui| {
let (icon, color) = match &item.state {
ExecutionState::Idle => ("", egui::Color32::GRAY),
ExecutionState::Running => ("", egui::Color32::YELLOW),
ExecutionState::Success => ("", egui::Color32::GREEN),
ExecutionState::Cancelled => {
("", egui::Color32::from_rgb(255, 200, 0))
}
ExecutionState::Error(_) => ("", egui::Color32::RED),
};
ui.colored_label(color, icon);
ui.label(format!("#{}{}{}", idx + 1, source_name, output_name));
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
if !is_processing && matches!(item.state, ExecutionState::Idle) {
if ui.small_button("✕ Remover").clicked() {
events.push(BatchPanelEvent::RemoveItem(idx));
ui.push_id(("batch_item", idx), |ui| {
ui.group(|ui| {
ui.horizontal(|ui| {
let (icon, color) = match &item.state {
ExecutionState::Idle => ("", egui::Color32::GRAY),
ExecutionState::Running => ("", egui::Color32::YELLOW),
ExecutionState::Success => ("", egui::Color32::GREEN),
ExecutionState::Cancelled => {
("", egui::Color32::from_rgb(255, 200, 0))
}
if ui.small_button("✏ Editar").clicked() {
open_edit_for = Some(idx);
}
}
});
});
ExecutionState::Error(_) => ("", egui::Color32::RED),
};
ui.colored_label(color, icon);
ui.label(format!("#{}{} >> {}", idx + 1, source_name, output_name));
let track_count = item.project.tracks.len();
let existing_count = item.project.existing_tracks.len();
ui.label(
egui::RichText::new(format!(
" {} faixas existentes · {} faixas adicionadas",
existing_count, track_count
))
.small()
.weak(),
);
if let ExecutionState::Error(msg) = &item.state {
ui.colored_label(egui::Color32::RED, format!(" Erro: {}", msg));
}
if !item.log_lines.is_empty() {
ui.collapsing("Log detalhado", |ui| {
egui::ScrollArea::vertical()
.max_height(120.0)
.show(ui, |ui| {
for line in &item.log_lines {
ui.label(egui::RichText::new(line).monospace().size(10.0));
ui.with_layout(
egui::Layout::right_to_left(egui::Align::Center),
|ui| {
if !is_processing && matches!(item.state, ExecutionState::Idle)
{
if ui.small_button("🗑 Remover").clicked() {
events.push(BatchPanelEvent::RemoveItem(idx));
}
if ui.small_button("✏ Editar").clicked() {
open_edit_for = Some(idx);
}
}
});
},
);
});
}
});
let track_count = item.project.tracks.len();
let existing_count = item.project.existing_tracks.len();
ui.label(
egui::RichText::new(format!(
" {} faixas existentes · {} faixas adicionadas",
existing_count, track_count
))
.small()
.weak(),
);
if let ExecutionState::Error(msg) = &item.state {
ui.colored_label(egui::Color32::RED, format!(" Erro: {}", msg));
}
if !item.log_lines.is_empty() {
ui.collapsing("Log detalhado", |ui| {
egui::ScrollArea::vertical()
.max_height(120.0)
.show(ui, |ui| {
for line in &item.log_lines {
ui.label(
egui::RichText::new(line).monospace().size(10.0),
);
}
});
});
}
});
}); // push_id
ui.add_space(4.0);
}
@@ -364,18 +372,20 @@ impl BatchPanel {
.file_name()
.and_then(|n| n.to_str())
.unwrap_or("");
ui.horizontal(|ui| {
ui.label(
egui::RichText::new(format!(" 🎵 {} [{}]", name, audio.language))
.small(),
);
if ui
.small_button("")
.on_hover_text("Remover faixa")
.clicked()
{
remove_audio = Some(i);
}
ui.push_id(("audio", i), |ui| {
ui.horizontal(|ui| {
ui.label(
egui::RichText::new(format!(" 🎵 {} [{}]", name, audio.language))
.small(),
);
if ui
.small_button("🗑")
.on_hover_text("Remover faixa")
.clicked()
{
remove_audio = Some(i);
}
});
});
}
if let Some(i) = remove_audio {
@@ -390,18 +400,20 @@ impl BatchPanel {
.file_name()
.and_then(|n| n.to_str())
.unwrap_or("");
ui.horizontal(|ui| {
ui.label(
egui::RichText::new(format!(" 💬 {} [{}]", name, sub.language))
.small(),
);
if ui
.small_button("")
.on_hover_text("Remover faixa")
.clicked()
{
remove_sub = Some(i);
}
ui.push_id(("sub", i), |ui| {
ui.horizontal(|ui| {
ui.label(
egui::RichText::new(format!(" 💬 {} [{}]", name, sub.language))
.small(),
);
if ui
.small_button("🗑")
.on_hover_text("Remover faixa")
.clicked()
{
remove_sub = Some(i);
}
});
});
}
if let Some(i) = remove_sub {