Rework section list style

This commit is contained in:
crschnick
2024-09-21 12:43:53 +00:00
parent a443f37092
commit a146fbd936
2 changed files with 21 additions and 4 deletions

View File

@@ -26,6 +26,8 @@ public class ListBoxViewComp<T> extends Comp<CompStructure<ScrollPane>> {
private static final PseudoClass ODD = PseudoClass.getPseudoClass("odd");
private static final PseudoClass EVEN = PseudoClass.getPseudoClass("even");
private static final PseudoClass FIRST = PseudoClass.getPseudoClass("first");
private static final PseudoClass LAST = PseudoClass.getPseudoClass("last");
private final ObservableList<T> shown;
private final ObservableList<T> all;
@@ -114,9 +116,10 @@ public class ListBoxViewComp<T> extends Comp<CompStructure<ScrollPane>> {
for (int i = 0; i < newShown.size(); i++) {
var r = newShown.get(i);
r.pseudoClassStateChanged(ODD, false);
r.pseudoClassStateChanged(EVEN, false);
r.pseudoClassStateChanged(i % 2 == 0 ? EVEN : ODD, true);
r.pseudoClassStateChanged(ODD, i % 2 != 0);
r.pseudoClassStateChanged(EVEN, i % 2 == 0);
r.pseudoClassStateChanged(FIRST, i == 0);
r.pseudoClassStateChanged(LAST, i == newShown.size() - 1);
}
var d = new DerivedObservableList<>(listView.getChildren(), true);

View File

@@ -111,7 +111,7 @@
}
.store-entry-section-comp > .children-content {
-fx-padding: 5px 0 5px 25px;
-fx-padding: 5px 0 0 25px;
}
.store-entry-section-comp > .separator .line {
@@ -136,6 +136,20 @@
-fx-background-radius: 4 0 0 4;
}
.store-entry-section-comp:last:sub:expanded {
-fx-border-width: 1 0 0 1;
-fx-background-radius: 4 0 0 0;
-fx-border-radius: 4 0 0 0;
}
.store-entry-section-comp:last:sub {
-fx-padding: 0 0 3 0;
}
.store-entry-section-comp:last:sub:expanded {
-fx-padding: 0;
}
.root.nord .store-entry-section-comp {
-fx-border-radius: 0;
-fx-background-radius: 0;