#866: Layer > New > Text starts typing into Source Text

Problem: Layer > New > Text (menu, Ctrl+Alt+Shift+T, Timeline context menus)
created a layer with the placeholder "Text" and no edit session, so typed keys
ran shortcuts; users then renamed the layer (Enter) and the name, not the
Source Text, got their text.

Fix: as in After Effects, the UI dispatch runs layer.newText with an empty
text and an edit session (insertion point in the comp centre); the name
follows the typed text. engine.execute keeps the headless default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vangel76
2026-10-11 17:46:01 +02:00
co-authored by Claude Opus 5.5
parent 9a7d3e7699
commit 1226576a92
3 changed files with 38 additions and 2 deletions
+2 -2
View File
@@ -2661,7 +2661,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
response.context_menu(|ui| {
let menu = ui.menu_button(crate::i18n::tr("New"), |ui| {
for (key, label, command, params) in [
("text", "Text", "layer.newText", json!({"text": "Text"})),
("text", "Text", "layer.newText", json!({})),
("solid", "Solid…", "layer.newSolid", json!({})),
("light", "Light…", "layer.newLight", json!({})),
("camera", "Camera…", "layer.newCamera", json!({})),
@@ -3457,7 +3457,7 @@ pub(crate) fn layer_menu(ui: &mut egui::Ui, layers: &[u64], actions: &mut Vec<(S
}
};
ui.menu_button(crate::i18n::tr("New"), |ui| {
item(ui, "Text", "layer.newText", json!({"text": "Text"}));
item(ui, "Text", "layer.newText", json!({}));
item(ui, "Solid…", "app.solidSettings", json!({}));
item(ui, "Light…", "layer.newLight", json!({}));
item(ui, "Camera…", "layer.newCamera", json!({}));