Focus provider combobox

This commit is contained in:
crschnick 2023-11-24 08:36:27 +00:00
parent 774b005588
commit 88c5c1c7ac
2 changed files with 8 additions and 0 deletions

View file

@ -266,6 +266,7 @@ public class GuiDsStoreCreator extends MultiStepComp.Step<CompStructure<?>> {
providerChoice.apply(struc -> struc.get().setDisable(true));
}
providerChoice.apply(GrowAugment.create(true, false));
providerChoice.onSceneAssign(struc -> struc.get().requestFocus());
SimpleChangeListener.apply(provider, n -> {
if (n != null) {

View file

@ -84,6 +84,13 @@ public abstract class Comp<S extends CompStructure<?>> {
return apply(struc -> struc.get().setPrefHeight(height));
}
public <T extends Comp<S>> T onSceneAssign(Augment<S> augment) {
return apply(struc -> struc.get().sceneProperty().addListener((observable, oldValue, newValue) -> {
if (newValue != null) {
augment.augment(struc);
}
}));
}
public Comp<S> maxWidth(int width) {
return apply(struc -> struc.get().setMaxWidth(width));