Add more logging for layout content loading [stage]

This commit is contained in:
crschnick 2025-03-16 10:13:36 +00:00
parent 484028f22f
commit bffe75a540
6 changed files with 19 additions and 6 deletions

View file

@ -207,7 +207,7 @@ public class BrowserFileSystemTabComp extends SimpleComp {
home,
model.getCurrentPath().isNull(),
fileList,
model.getCurrentPath().isNull().not()));
model.getCurrentPath().isNull().not()), false);
var r = stack.styleClass("browser-content-container").createRegion();
r.focusedProperty().addListener((observable, oldValue, newValue) -> {
if (newValue) {

View file

@ -60,7 +60,7 @@ public class BrowserHistoryTabComp extends SimpleComp {
var map = new LinkedHashMap<Comp<?>, ObservableValue<Boolean>>();
map.put(emptyDisplay, empty);
map.put(contentDisplay, empty.not());
var stack = new MultiContentComp(map);
var stack = new MultiContentComp(map, false);
return stack.createRegion();
}

View file

@ -39,7 +39,7 @@ public class AppLayoutComp extends Comp<AppLayoutComp.Structure> {
return model.getSelected().getValue().equals(entry);
},
model.getSelected())));
var multi = new MultiContentComp(map);
var multi = new MultiContentComp(map, true);
multi.styleClass("background");
var pane = new BorderPane();

View file

@ -2,6 +2,7 @@ package io.xpipe.app.comp.base;
import io.xpipe.app.comp.Comp;
import io.xpipe.app.comp.SimpleComp;
import io.xpipe.app.issue.TrackEvent;
import io.xpipe.app.util.PlatformThread;
import javafx.beans.value.ObservableValue;
@ -15,9 +16,11 @@ import java.util.Map;
public class MultiContentComp extends SimpleComp {
private final boolean log;
private final Map<Comp<?>, ObservableValue<Boolean>> content;
public MultiContentComp(Map<Comp<?>, ObservableValue<Boolean>> content) {
public MultiContentComp(Map<Comp<?>, ObservableValue<Boolean>> content, boolean log) {
this.log = log;
this.content = FXCollections.observableMap(content);
}
@ -34,7 +37,14 @@ public class MultiContentComp extends SimpleComp {
});
for (Map.Entry<Comp<?>, ObservableValue<Boolean>> e : content.entrySet()) {
var name = e.getKey().getClass().getSimpleName();
if (log) {
TrackEvent.trace("Creating content tab region for element " + name);
}
var r = e.getKey().createRegion();
if (log) {
TrackEvent.trace("Created content tab region for element " + name);
}
e.getValue().subscribe(val -> {
PlatformThread.runLaterIfNeeded(() -> {
r.setManaged(val);
@ -42,6 +52,9 @@ public class MultiContentComp extends SimpleComp {
});
});
m.put(e.getKey(), r);
if (log) {
TrackEvent.trace("Added content tab region for element " + name);
}
}
return stack;

View file

@ -142,6 +142,6 @@ public class StoreEntryListComp extends SimpleComp {
map.put(new StoreScriptsIntroComp(scriptsIntroShowing), showScriptsIntro);
map.put(new StoreIdentitiesIntroComp(), showIdentitiesIntro);
return new MultiContentComp(map).createRegion();
return new MultiContentComp(map, false).createRegion();
}
}

View file

@ -1 +1 @@
15.6-4
15.6-5