diff --git a/app/src/main/java/io/xpipe/app/comp/base/ListBoxViewComp.java b/app/src/main/java/io/xpipe/app/comp/base/ListBoxViewComp.java index 1bdab4a5f..d8a2ec5aa 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/ListBoxViewComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/ListBoxViewComp.java @@ -44,6 +44,9 @@ public class ListBoxViewComp extends RegionBuilder { @Setter private boolean visibilityControl = false; + @Setter + private boolean fixScrollReset = false; + public ListBoxViewComp( ObservableList shown, ObservableList all, @@ -135,17 +138,20 @@ public class ListBoxViewComp extends RegionBuilder { } }; - scroll.vvalueProperty().addListener((observable, oldValue, newValue) -> { - // Fix scrollbar resetting on fast scroll - // If one node within has focus and moves out of focus fast, - // the scrollbar will try to focus another one and move it into view - // This can result in flicker when scrolling fast enough - var hasWindowFocus = scroll.getScene().getWindow().isFocused(); - if (scroll.isFocusWithin() || !hasWindowFocus) { - scroll.requestFocus(); - } - dirty.set(true); - }); + if (fixScrollReset) { + scroll.vvalueProperty().addListener((observable, oldValue, newValue) -> { + // Fix scrollbar resetting on fast scroll + // If one node within has focus and moves out of focus fast, + // the scrollbar will try to focus another one and move it into view + // This can result in flicker when scrolling fast enough + var hasWindowFocus = scroll.getScene().getWindow().isFocused(); + if (scroll.isFocusWithin() || !hasWindowFocus) { + scroll.requestFocus(); + } + dirty.set(true); + }); + } + scroll.heightProperty().addListener((observable, oldValue, newValue) -> { dirty.set(true); }); diff --git a/app/src/main/java/io/xpipe/app/hub/category/StoreCategoryComp.java b/app/src/main/java/io/xpipe/app/hub/category/StoreCategoryComp.java index b5b157167..9e46f7bbf 100644 --- a/app/src/main/java/io/xpipe/app/hub/category/StoreCategoryComp.java +++ b/app/src/main/java/io/xpipe/app/hub/category/StoreCategoryComp.java @@ -211,6 +211,7 @@ public class StoreCategoryComp extends SimpleRegionBuilder { children.style("children"); children.minHeight(0); children.setVisibilityControl(true); + children.setFixScrollReset(true); var hide = Bindings.createBooleanBinding( () -> { diff --git a/app/src/main/java/io/xpipe/app/hub/list/StoreEntryListComp.java b/app/src/main/java/io/xpipe/app/hub/list/StoreEntryListComp.java index 021f4cfd5..ef484b78e 100644 --- a/app/src/main/java/io/xpipe/app/hub/list/StoreEntryListComp.java +++ b/app/src/main/java/io/xpipe/app/hub/list/StoreEntryListComp.java @@ -52,6 +52,7 @@ public class StoreEntryListComp extends SimpleRegionBuilder { }, true); content.setVisibilityControl(true); + content.setFixScrollReset(true); content.apply(struc -> { // Reset scroll StoreViewState.get().getActiveCategory().addListener((observable, oldValue, newValue) -> { diff --git a/app/src/main/java/io/xpipe/app/hub/section/StoreSectionBaseComp.java b/app/src/main/java/io/xpipe/app/hub/section/StoreSectionBaseComp.java index 969e548b1..c76507839 100644 --- a/app/src/main/java/io/xpipe/app/hub/section/StoreSectionBaseComp.java +++ b/app/src/main/java/io/xpipe/app/hub/section/StoreSectionBaseComp.java @@ -156,6 +156,7 @@ public abstract class StoreSectionBaseComp extends RegionBuilder { function, section.getWrapper() == null); content.setVisibilityControl(true); + content.setFixScrollReset(true); content.minHeight(0); content.hgrow(); content.style("children-content"); diff --git a/app/src/main/resources/io/xpipe/app/resources/style/category.css b/app/src/main/resources/io/xpipe/app/resources/style/category.css index 70c9dca6a..e2bfb87aa 100644 --- a/app/src/main/resources/io/xpipe/app/resources/style/category.css +++ b/app/src/main/resources/io/xpipe/app/resources/style/category.css @@ -36,7 +36,7 @@ } .root:light .category:recursive:selected { - -fx-background-color: -color-border-default, derive(-color-bg-default, 10%); + -fx-background-color: derive(-color-border-default, -20%), derive(-color-bg-default, 10%); -fx-background-insets: 0, 1; -fx-background-radius: 4px; -fx-border-radius: 4px; diff --git a/app/src/main/resources/io/xpipe/app/resources/style/color-box.css b/app/src/main/resources/io/xpipe/app/resources/style/color-box.css index 31ab8b22a..b8e31b427 100644 --- a/app/src/main/resources/io/xpipe/app/resources/style/color-box.css +++ b/app/src/main/resources/io/xpipe/app/resources/style/color-box.css @@ -15,7 +15,7 @@ } .root:pretty:dark .color-box.gray { - -fx-background-color: linear-gradient(from 100% 0% to 0% 100%, derive(-color-bg-default, 5%) 40%, derive(-color-bg-default, 1%) 50%, derive(-color-bg-default, 5%) 100%); + -fx-background-color: linear-gradient(from 100% 0% to 0% 100%, derive(-color-bg-default, 10%) 40%, derive(-color-bg-default, 6%) 50%, derive(-color-bg-default, 10%) 100%); -fx-border-color: -color-border-default; }