Skip to content

EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust

Character eyedroppers: the sampling hints go through the catalog

Brandon Thomas37c4e9850215
diff --git a/crates/ui-egui/src/panels/effect_controls.rs b/crates/ui-egui/src/panels/effect_controls.rs
index 4f449e8c9..81c2dd724 100644
--- a/crates/ui-egui/src/panels/effect_controls.rs
+++ b/crates/ui-egui/src/panels/effect_controls.rs
@@ -1397,7 +1397,7 @@ pub fn viewer_hook(
app.auto.add("viewer.textColorPick", map.area, &pick.field);
let chip = Rect::from_min_size(map.area.min + vec2(10.0, 10.0), vec2(220.0, 22.0));
painter.rect_filled(chip, 11.0, Color32::from_black_alpha(180));
- painter.text(chip.center(), Align2::CENTER_CENTER, format!("Click to sample text {}", pick.field), Tokens::ui(11.5), t.text);
+ painter.text(chip.center(), Align2::CENTER_CENTER, crate::i18n::tr_args("Click to sample text {}", &[&pick.field]), Tokens::ui(11.5), t.text);
if let Some(pos) = resp.hover_pos() {
ctx.set_cursor_icon(egui::CursorIcon::Crosshair);
let c = map.to_comp(pos);
diff --git a/crates/ui-egui/src/panels/text_panels.rs b/crates/ui-egui/src/panels/text_panels.rs
index 73176f18f..2a4fb647c 100644
--- a/crates/ui-egui/src/panels/text_panels.rs
+++ b/crates/ui-egui/src/panels/text_panels.rs
@@ -213,7 +213,7 @@ pub fn character(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
} else if let Some(tt) = &target {
app.ui.fx_pick = None;
app.ui.text_color_pick = Some(TextColorPick { layer: tt.layer, field: key.into(), range: tt.range });
- app.ui.status = format!("Click in the Composition panel to sample text {label}");
+ app.ui.status = crate::i18n::tr_args("Click in the Composition panel to sample text {}", &[&label]);
}
}
p.text(pos2(er.max.x + 6.0, y + 10.0), Align2::LEFT_CENTER, label, Tokens::ui(11.5), t.text_dim);