Reset scroll and layout change

This commit is contained in:
crschnick 2024-09-16 09:25:22 +00:00
parent 1fbf1ada20
commit 674577874e

View file

@ -2,6 +2,7 @@ package io.xpipe.app.comp.store;
import io.xpipe.app.comp.base.ListBoxViewComp;
import io.xpipe.app.comp.base.MultiContentComp;
import io.xpipe.app.core.AppLayoutModel;
import io.xpipe.app.fxcomps.Comp;
import io.xpipe.app.fxcomps.SimpleComp;
@ -34,6 +35,12 @@ public class StoreEntryListComp extends SimpleComp {
struc.get().setVvalue(0);
});
});
content.apply(struc -> {
// Reset scroll
AppLayoutModel.get().getSelected().addListener((observable, oldValue, newValue) -> {
struc.get().setVvalue(0);
});
});
return content.styleClass("store-list-comp");
}