From 16dcb0b9d4090876c38ee012973189c246713da6 Mon Sep 17 00:00:00 2001 From: Felipe Canin Novaes Date: Sat, 28 Feb 2026 16:55:42 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20ajusta=20exibi=C3=A7=C3=A3o=20de=20cami?= =?UTF-8?q?nhos=20de=20arquivos=20nos=20seletores=20de=20v=C3=ADdeo=20e=20?= =?UTF-8?q?sa=C3=ADda,=20adicionando=20truncamento=20e=20tooltip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/components/added_track_list.rs | 4 +++- src/ui/components/output_selector.rs | 28 +++++++++++++++++++-------- src/ui/components/video_selector.rs | 28 +++++++++++++++++++-------- 3 files changed, 43 insertions(+), 17 deletions(-) diff --git a/src/ui/components/added_track_list.rs b/src/ui/components/added_track_list.rs index a423cba..db92bd5 100644 --- a/src/ui/components/added_track_list.rs +++ b/src/ui/components/added_track_list.rs @@ -29,6 +29,7 @@ impl AddedTrackList { egui::Grid::new("added_tracks_grid") .num_columns(4) + .max_col_width(200.0) .striped(true) .show(ui, |ui| { ui.strong("Tipo"); @@ -62,7 +63,8 @@ impl AddedTrackList { }; 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); if ui.small_button("🗑 Remover").clicked() { diff --git a/src/ui/components/output_selector.rs b/src/ui/components/output_selector.rs index f075b6e..c71875f 100644 --- a/src/ui/components/output_selector.rs +++ b/src/ui/components/output_selector.rs @@ -22,14 +22,6 @@ impl OutputSelector { ui.group(|ui| { ui.heading("Arquivo de saída (.mkv)"); 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() { let stem = source_stem.unwrap_or("output"); if let Some(path) = FilePickerAdapter::pick_output(stem) { @@ -37,6 +29,26 @@ impl OutputSelector { 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 }); }); }); diff --git a/src/ui/components/video_selector.rs b/src/ui/components/video_selector.rs index 16e198f..8054634 100644 --- a/src/ui/components/video_selector.rs +++ b/src/ui/components/video_selector.rs @@ -20,20 +20,32 @@ impl VideoSelector { ui.group(|ui| { ui.heading("Arquivo de vídeo"); 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 let Some(path) = FilePickerAdapter::pick_video() { self.selected_path = Some(path.clone()); 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 }); }); });