live preview: Implement resizing and moving of selected eleement

Much polish needed, but it is a basis to build upon.
This commit is contained in:
Tobias Hunger 2024-02-16 12:28:22 +01:00 committed by Tobias Hunger
parent e1aefc6f16
commit 08372e5a07
10 changed files with 427 additions and 44 deletions

View file

@ -25,6 +25,7 @@ export component PreviewUi inherits Window {
pure callback can-drop(/* component_type */ string, /* x */ length, /* y */ length) -> bool;
callback drop(/* component_type */ string, /* import_path */ string, /* is_layout */ bool, /* x */ length, /* y */ length);
callback selected-element-update-geometry(/* x */ length, /* y */ length, /* width */ length, /* height */ length);
callback select-at(/* x */ length, /* y */ length, /* enter_component? */ bool);
callback select-behind(/* x */ length, /* y */ length, /* enter_component* */ bool, /* reverse */ bool);
callback show-document(/* url */ string, /* line */ int, /* column */ int);
@ -115,6 +116,7 @@ export component PreviewUi inherits Window {
selections <=> root.selections;
select-at(x, y, enter_component) => { root.select-at(x, y, enter_component); }
selected-element-update-geometry(x, y, w, h) => { root.selected-element-update-geometry(x, y, w, h); }
select-behind(x, y, stay_in_file, reverse) => { root.select-behind(x, y, stay_in_file, reverse); }
show-document(url, line, column) => { root.show-document(url, line, column); }
unselect() => { root.unselect(); }