feat: ajusta exibição de caminhos de arquivos nos seletores de vídeo e saída, adicionando truncamento e tooltip

This commit is contained in:
2026-02-28 16:55:42 -03:00
parent 7c7f86b131
commit 16dcb0b9d4
3 changed files with 43 additions and 17 deletions
+3 -1
View File
@@ -29,6 +29,7 @@ impl AddedTrackList {
egui::Grid::new("added_tracks_grid") egui::Grid::new("added_tracks_grid")
.num_columns(4) .num_columns(4)
.max_col_width(200.0)
.striped(true) .striped(true)
.show(ui, |ui| { .show(ui, |ui| {
ui.strong("Tipo"); ui.strong("Tipo");
@@ -62,7 +63,8 @@ impl AddedTrackList {
}; };
ui.label(kind_label); ui.label(kind_label);
ui.label(&file_name).on_hover_text(track_full_path(track)); ui.add(egui::Label::new(&file_name).truncate(true))
.on_hover_text(track_full_path(track));
ui.label(language); ui.label(language);
if ui.small_button("🗑 Remover").clicked() { if ui.small_button("🗑 Remover").clicked() {
+20 -8
View File
@@ -22,14 +22,6 @@ impl OutputSelector {
ui.group(|ui| { ui.group(|ui| {
ui.heading("Arquivo de saída (.mkv)"); ui.heading("Arquivo de saída (.mkv)");
ui.horizontal(|ui| { ui.horizontal(|ui| {
let label = self
.selected_path
.as_ref()
.map(|p| p.to_string_lossy().to_string())
.unwrap_or_else(|| "Nenhum destino selecionado".to_string());
ui.label(&label);
if ui.button("Salvar como…").clicked() { if ui.button("Salvar como…").clicked() {
let stem = source_stem.unwrap_or("output"); let stem = source_stem.unwrap_or("output");
if let Some(path) = FilePickerAdapter::pick_output(stem) { if let Some(path) = FilePickerAdapter::pick_output(stem) {
@@ -37,6 +29,26 @@ impl OutputSelector {
selected = Some(path); selected = Some(path);
} }
} }
let full_path = self
.selected_path
.as_ref()
.map(|p| p.to_string_lossy().to_string())
.unwrap_or_default();
let display = self
.selected_path
.as_ref()
.map(|p| {
p.as_path()
.file_name()
.and_then(|n| n.to_str())
.unwrap_or("")
.to_string()
})
.unwrap_or_else(|| "Nenhum destino selecionado".to_string());
ui.add(egui::Label::new(&display).truncate(true))
.on_hover_text(if full_path.is_empty() { display } else { full_path });
}); });
}); });
+20 -8
View File
@@ -20,20 +20,32 @@ impl VideoSelector {
ui.group(|ui| { ui.group(|ui| {
ui.heading("Arquivo de vídeo"); ui.heading("Arquivo de vídeo");
ui.horizontal(|ui| { ui.horizontal(|ui| {
let label = self
.selected_path
.as_ref()
.map(|p| p.to_string_lossy().to_string())
.unwrap_or_else(|| "Nenhum arquivo selecionado".to_string());
ui.label(&label);
if ui.button("Selecionar…").clicked() { if ui.button("Selecionar…").clicked() {
if let Some(path) = FilePickerAdapter::pick_video() { if let Some(path) = FilePickerAdapter::pick_video() {
self.selected_path = Some(path.clone()); self.selected_path = Some(path.clone());
selected = Some(path); selected = Some(path);
} }
} }
let full_path = self
.selected_path
.as_ref()
.map(|p| p.to_string_lossy().to_string())
.unwrap_or_default();
let display = self
.selected_path
.as_ref()
.map(|p| {
p.as_path()
.file_name()
.and_then(|n| n.to_str())
.unwrap_or("")
.to_string()
})
.unwrap_or_else(|| "Nenhum arquivo selecionado".to_string());
ui.add(egui::Label::new(&display).truncate(true))
.on_hover_text(if full_path.is_empty() { display } else { full_path });
}); });
}); });