Merge pull request #1512 from CokeRoach/fx-folder-names

Effects panel: keep the whole name of a folder that contains a slash
This commit is contained in:
Brandon Thomas committed 2026-10-13 00:03:33 -04:00
commit 5f60d980f6
2 files changed
+8 -1

No files matched your search

+3 -1
View File
@@ -154,7 +154,9 @@ fn folder_row(app: &mut FilmcraftApp, ui: &mut egui::Ui, key: &str, depth: usize
t.text_dim,
);
icons::paint(ui.painter(), Rect::from_center_size(pos2(x + 18.0, r.center().y), vec2(13.0, 13.0)), Icon::Folder, t.text_dim);
let name = key.rsplit('/').next().unwrap_or(key);
// a sub-folder key is `<top>/<folder>`; folder names may themselves contain a slash
// (Audio Effects ▸ Noise Reduction/Restoration), so split once, after the top folder
let name = if depth == 0 { key } else { key.split_once('/').map_or(key, |(_, folder)| folder) };
ui.painter().text(pos2(x + 30.0, r.center().y), Align2::LEFT_CENTER, crate::i18n::t(name), Tokens::ui(12.0), t.text);
app.auto.add(&format!("effects.folder.{key}"), r, name);
if resp.clicked() {
+5
View File
@@ -231,6 +231,11 @@ fn effects_panel_lists_the_premiere_transition_folders() {
for id in ["additive_dissolve_legacy", "clock_wipe_legacy", "cross_dissolve_legacy", "push_legacy", "whip_legacy"] {
assert!(items.iter().any(|i| i == &format!("effects.item.{id}")), "{id}: {items:?}");
}
// a folder whose own name has a slash keeps all of it (Noise Reduction/Restoration, not Restoration)
d.ok("ui.set", json!({"effectsSearch": "denoise"}));
d.frames(3);
let noise = d.ok("ui.elements", json!({"prefix": "effects.folder.Audio Effects/Noise Reduction/Restoration"}));
assert_eq!(noise[0]["label"], json!("Noise Reduction/Restoration"), "{noise}");
// obsolete transitions stay out of the panel
d.ok("ui.set", json!({"effectsSearch": "venetian"}));
d.frames(3);