ui: a category lists its effects by name, as After Effects does

Co-Authored-By: DeepSeek V4.1 Flash <noreply@deepseek.com>
This commit is contained in:
zitann2020andDeepSeek V4.1 Flash committed 2026-10-31 22:27:55 +09:00
1 parent afa3c938f6
commit 85e0796559
1 file changed
+4 -1
+4 -1
View File
@@ -760,10 +760,13 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
let mut cats: Vec<&str> = effectcraft_engine::effects::categories();
cats.retain(|c| reg.iter().any(|e| e.category == *c));
for cat in cats {
let items: Vec<_> = reg.iter().filter(|e| e.category == cat && keep(e)).collect();
let mut items: Vec<_> = reg.iter().filter(|e| e.category == cat && keep(e)).collect();
if items.is_empty() {
continue;
}
// After Effects lists a category by the effect's English name, whatever the interface
// language draws; the registry's own order is packing order, which reads as random.
items.sort_by_key(|e| e.name.to_lowercase());
// The folder draws the category in the interface language; `cat` stays the key (the
// open/closed state and the automation id are the registry's English name).
if !folder_row(app, ui, &lp, list, &mut y, &mut nav, cat, &crate::i18n::effects::category(cat), 1, 0.0, searching, None) {