Merge pull request #936 from nanox333/codex/fix-902-essential-graphics-context
Open Essential Graphics from blank Timeline context menu
This commit is contained in:
@@ -2711,6 +2711,12 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
|
|||||||
actions.push(("comp.settings".into(), json!({})));
|
actions.push(("comp.settings".into(), json!({})));
|
||||||
ui.close();
|
ui.close();
|
||||||
}
|
}
|
||||||
|
let response = ui.button(crate::i18n::tr("Open in Essential Graphics"));
|
||||||
|
app.auto.add(&format!("timeline.context.{area}.essentialGraphics"), response.rect, "Open in Essential Graphics");
|
||||||
|
if response.clicked() {
|
||||||
|
actions.push(("comp.openInEssentialGraphics".into(), json!({})));
|
||||||
|
ui.close();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if outline_empty.clicked() && !ui.input(|i| i.modifiers.shift || i.modifiers.command) {
|
if outline_empty.clicked() && !ui.input(|i| i.modifiers.shift || i.modifiers.command) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//! Right-click actions in the blank Project and Timeline areas, and on Timeline property names.
|
//! Right-click actions in the blank Project and Timeline areas, and on Timeline property names.
|
||||||
use effectcraft_engine::Session;
|
use effectcraft_engine::Session;
|
||||||
use effectcraft_ui_egui::{Dialog, EffectcraftApp};
|
use effectcraft_ui_egui::{Dialog, EffectcraftApp, dock::PanelKind};
|
||||||
use egui::{Event, Modifiers, PointerButton, Pos2, Rect, pos2, vec2};
|
use egui::{Event, Modifiers, PointerButton, Pos2, Rect, pos2, vec2};
|
||||||
use egui_kittest::{Harness, kittest::Queryable as _};
|
use egui_kittest::{Harness, kittest::Queryable as _};
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
@@ -132,6 +132,23 @@ fn timeline_blank_menu_opens_composition_settings() {
|
|||||||
assert_eq!(h.state().dialog, Some(Dialog::CompSettings));
|
assert_eq!(h.state().dialog, Some(Dialog::CompSettings));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn timeline_blank_menu_opens_current_comp_in_essential_graphics() {
|
||||||
|
for graph in [false, true] {
|
||||||
|
let mut h = harness();
|
||||||
|
let comp = h.state().session.active_comp_id().unwrap();
|
||||||
|
let area = rect(&h, "timeline.layerMarquee");
|
||||||
|
let p = if graph { pos2(area.max.x + 150.0, area.center().y) } else { area.center() };
|
||||||
|
right_click(&mut h, p);
|
||||||
|
let target = if graph { "timeline.context.graph.essentialGraphics" } else { "timeline.context.outline.essentialGraphics" };
|
||||||
|
assert!(h.state().auto.find(target).is_some());
|
||||||
|
h.get_by_label("Open in Essential Graphics").click();
|
||||||
|
h.run_steps(3);
|
||||||
|
assert_eq!(h.state().session.state.essential_primary, Some(comp));
|
||||||
|
assert!(h.state().ui.dock.contains(PanelKind::EssentialGraphics));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// #407: right-clicking a property's name in the Timeline opens After Effects' property menu:
|
/// #407: right-clicking a property's name in the Timeline opens After Effects' property menu:
|
||||||
/// Reset, Edit Value…, Separate Dimensions (Position only, checked once separated), Add or
|
/// Reset, Edit Value…, Separate Dimensions (Position only, checked once separated), Add or
|
||||||
/// Remove Expression and Add Property to Essential Graphics.
|
/// Remove Expression and Add Property to Essential Graphics.
|
||||||
|
|||||||
Reference in New Issue
Block a user