Small fixes

This commit is contained in:
crschnick 2024-06-21 01:07:48 +00:00
parent 33302fb75d
commit 5e90f169b1
5 changed files with 20 additions and 13 deletions

View file

@ -115,6 +115,7 @@ public class BrowserChooserComp extends SimpleComp {
var splitPane = new SideSplitPaneComp(bookmarksList, stack)
.withInitialWidth(AppLayoutModel.get().getSavedState().getBrowserConnectionsWidth())
.withOnDividerChange(AppLayoutModel.get().getSavedState()::setBrowserConnectionsWidth)
.styleClass("background")
.apply(struc -> {
struc.getLeft().setMinWidth(200);
struc.getLeft().setMaxWidth(500);

View file

@ -71,6 +71,10 @@ public class StoreSection {
var explicitOrderComp = Comparator.<StoreSection>comparingInt(new ToIntFunction<>() {
@Override
public int applyAsInt(StoreSection value) {
if (!value.getWrapper().getEntry().getValidity().isUsable()) {
return 1;
}
var explicit = value.getWrapper().getEntry().getExplicitOrder();
if (explicit == null) {
return 0;
@ -82,20 +86,22 @@ public class StoreSection {
};
}
});
var usableComp = Comparator.<StoreSection>comparingInt(
value -> value.getWrapper().getEntry().getValidity().isUsable() ? -1 : 1);
var comp = explicitOrderComp.thenComparing(usableComp);
var comp = explicitOrderComp;
var mappedSortMode = BindingsHelper.flatMap(
category,
storeCategoryWrapper -> storeCategoryWrapper != null ? storeCategoryWrapper.getSortMode() : null);
return list.sorted(
(o1, o2) -> {
var r = comp.compare(o1, o2);
if (r != 0) {
return r;
}
var current = mappedSortMode.getValue();
if (current != null) {
return comp.thenComparing(current.comparator())
.compare(current.representative(o1), current.representative(o2));
return current.comparator().compare(current.representative(o1), current.representative(o2));
} else {
return comp.compare(o1, o2);
return 0;
}
},
mappedSortMode,

View file

@ -145,7 +145,7 @@ public class StoreSectionMiniComp extends Comp<CompStructure<VBox>> {
.hgrow();
list.add(new HorizontalComp(List.of(content))
.styleClass("content")
.styleClass("children-content")
.apply(struc -> struc.get().setFillHeight(true))
.hide(Bindings.or(
Bindings.not(expanded),

View file

@ -1,4 +1,4 @@
.store-mini-list-comp > * > * > .content {
.store-mini-list-comp > * > * > .children-content {
-fx-spacing: 0.5em;
}
@ -65,15 +65,15 @@
-fx-border-insets: 0px;
}
.store-section-mini-comp > .content {
.store-section-mini-comp > .children-content {
-fx-padding: 5px 0 5px 15px;
}
.store-section-mini-comp:root > .content {
.store-section-mini-comp:root > .children-content {
-fx-padding: 0.5em 1em 0.5em 1em;
}
.store-section-mini-comp.condensed:root > .content {
.store-section-mini-comp.condensed:root > .children-content {
-fx-padding: 0;
}
@ -118,7 +118,7 @@
-fx-border-color: -color-border-default;
}
.store-section-mini-comp .list-box-view-comp .content {
.store-section-mini-comp .list-box-view-comp .children-content {
-fx-spacing: 0.4em;
}

View file

@ -1,3 +1,3 @@
.toggle-switch-comp:hover > .thumb-area, .root:key-navigation .toggle-switch-comp:focused > .thumb-area {
-fx-background-color: -color-neutral-muted;
-fx-background-color: -color-neutral-emphasis;
}