Erweiterungen
This commit is contained in:
@@ -300,7 +300,10 @@ public class PDFBuilderView extends Div {
|
|||||||
String itemId = f.id != null ? f.id : "";
|
String itemId = f.id != null ? f.id : "";
|
||||||
row.setId("inspector-item-" + itemId);
|
row.setId("inspector-item-" + itemId);
|
||||||
|
|
||||||
// Check if this item should be collapsed
|
// Check if this item should be collapsed - if not tracked yet, make it initially collapsed
|
||||||
|
if (!collapsedItems.contains(itemId)) {
|
||||||
|
collapsedItems.add(itemId); // Make new tools initially collapsed
|
||||||
|
}
|
||||||
boolean isItemCollapsed = collapsedItems.contains(itemId);
|
boolean isItemCollapsed = collapsedItems.contains(itemId);
|
||||||
if (isItemCollapsed) {
|
if (isItemCollapsed) {
|
||||||
row.addClassName("fields-collapsed");
|
row.addClassName("fields-collapsed");
|
||||||
@@ -333,11 +336,11 @@ public class PDFBuilderView extends Div {
|
|||||||
NumberField w = makeField("Breite", f.width);
|
NumberField w = makeField("Breite", f.width);
|
||||||
NumberField h = makeField("Höhe", f.height);
|
NumberField h = makeField("Höhe", f.height);
|
||||||
|
|
||||||
// Update handlers (nur Client-Änderungen)
|
// Update handlers (nur Client-Änderungen) - without inspector refresh to prevent auto-collapse
|
||||||
x.addValueChangeListener(e -> { if (e.isFromClient()) setFrameRect(f.id, x.getValue(), y.getValue(), w.getValue(), h.getValue()); });
|
x.addValueChangeListener(e -> { if (e.isFromClient()) setFrameRect(f.id, x.getValue(), y.getValue(), w.getValue(), h.getValue(), false); });
|
||||||
y.addValueChangeListener(e -> { if (e.isFromClient()) setFrameRect(f.id, x.getValue(), y.getValue(), w.getValue(), h.getValue()); });
|
y.addValueChangeListener(e -> { if (e.isFromClient()) setFrameRect(f.id, x.getValue(), y.getValue(), w.getValue(), h.getValue(), false); });
|
||||||
w.addValueChangeListener(e -> { if (e.isFromClient()) setFrameRect(f.id, x.getValue(), y.getValue(), w.getValue(), h.getValue()); });
|
w.addValueChangeListener(e -> { if (e.isFromClient()) setFrameRect(f.id, x.getValue(), y.getValue(), w.getValue(), h.getValue(), false); });
|
||||||
h.addValueChangeListener(e -> { if (e.isFromClient()) setFrameRect(f.id, x.getValue(), y.getValue(), w.getValue(), h.getValue()); });
|
h.addValueChangeListener(e -> { if (e.isFromClient()) setFrameRect(f.id, x.getValue(), y.getValue(), w.getValue(), h.getValue(), false); });
|
||||||
|
|
||||||
// Add fields to container vertically
|
// Add fields to container vertically
|
||||||
fieldsContainer.add(x, y, w, h);
|
fieldsContainer.add(x, y, w, h);
|
||||||
@@ -358,6 +361,10 @@ public class PDFBuilderView extends Div {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setFrameRect(String id, Double x, Double y, Double w, Double h){
|
private void setFrameRect(String id, Double x, Double y, Double w, Double h){
|
||||||
|
setFrameRect(id, x, y, w, h, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setFrameRect(String id, Double x, Double y, Double w, Double h, boolean refreshInspector){
|
||||||
if (id == null || id.isBlank()) return;
|
if (id == null || id.isBlank()) return;
|
||||||
double dx = x == null ? 0 : Math.max(0, x);
|
double dx = x == null ? 0 : Math.max(0, x);
|
||||||
double dy = y == null ? 0 : Math.max(0, y);
|
double dy = y == null ? 0 : Math.max(0, y);
|
||||||
@@ -367,8 +374,10 @@ public class PDFBuilderView extends Div {
|
|||||||
UI.getCurrent().getPage().executeJs(js);
|
UI.getCurrent().getPage().executeJs(js);
|
||||||
// Serverliste aktualisieren
|
// Serverliste aktualisieren
|
||||||
upsertServerFrame(id, null, null, (int)dx, (int)dy, (int)dw, (int)dh);
|
upsertServerFrame(id, null, null, (int)dx, (int)dy, (int)dw, (int)dh);
|
||||||
// Danach Inspector neu laden (deferred, damit Styles/DOM sicher angewendet sind)
|
// Nur Inspector neu laden wenn gewünscht (nicht bei Eingabefeld-Änderungen)
|
||||||
refreshInspectorFromDomDeferred();
|
if (refreshInspector) {
|
||||||
|
refreshInspectorFromDomDeferred();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void upsertServerFrame(String id, String name, String type, Integer x, Integer y, Integer width, Integer height) {
|
private void upsertServerFrame(String id, String name, String type, Integer x, Integer y, Integer width, Integer height) {
|
||||||
|
|||||||
Reference in New Issue
Block a user