Category display fixes

This commit is contained in:
crschnick 2024-10-03 20:51:02 +00:00
parent d0b62d4cbd
commit be464120fa
4 changed files with 13 additions and 1 deletions

View file

@ -35,7 +35,9 @@ public class ScrollComp extends Comp<CompStructure<ScrollPane>> {
.bind(Bindings.createDoubleBinding(
() -> {
var v = bar.getVisibleAmount();
return v < 1.0 ? 1.0 : 0.0;
// Check for rounding and accuracy issues
// It might not be exactly equal to 1.0
return v < 0.99 ? 1.0 : 0.0;
},
bar.visibleAmountProperty()));

View file

@ -118,6 +118,7 @@ public class StoreCategoryComp extends SimpleComp {
StoreViewState.get().getFilterString())
.getList();
var count = new CountComp<>(shownList, category.getAllContainedEntries(), string -> "(" + string + ")");
count.visible(Bindings.isNotEmpty(shownList));
var showStatus = hover.or(new SimpleBooleanProperty(DataStorage.get().supportsSharing()))
.or(showing);

View file

@ -3,6 +3,7 @@ package io.xpipe.app.fxcomps.impl;
import io.xpipe.app.comp.store.StoreCategoryWrapper;
import io.xpipe.app.fxcomps.SimpleComp;
import javafx.beans.binding.Bindings;
import javafx.scene.layout.Region;
public class StoreCategoryListComp extends SimpleComp {
@ -17,6 +18,13 @@ public class StoreCategoryListComp extends SimpleComp {
protected Region createSimple() {
var sp = new ScrollComp(new StoreCategoryComp(root));
sp.styleClass("store-category-bar");
sp.apply(struc -> {
Region content = (Region) struc.get().getContent();
struc.get().minHeightProperty().bind(Bindings.createDoubleBinding(() -> {
var h = content.getHeight();
return Math.min(200, h + 2);
}, content.heightProperty()));
});
return sp.createRegion();
}
}

View file

@ -22,6 +22,7 @@
-fx-background-insets: 0;
-fx-padding: 0;
-fx-background-color: transparent;
-fx-border-insets: 0;
}
.scroll-pane:focused {