fix(shell): let the folder tree grow instead of scrolling internally
A bound prefHeight is only ever a request — TreeView's own max height stayed unconstrained, so an ancestor giving it less room than that let its internal ScrollBar pick up the difference instead of the tree actually growing. Pinning min/max to USE_PREF_SIZE forces it to grow, so NavigationSidebar's own outer ScrollPane is the only one that scrolls.
This commit is contained in:
@@ -143,6 +143,13 @@ public class LibraryFolderTree extends StackPane implements Disposable {
|
||||
// already tracks branch expand/collapse and root add/remove alike, so this needs no separate
|
||||
// listener of its own.
|
||||
tree.prefHeightProperty().bind(tree.expandedItemCountProperty().multiply(32).add(2));
|
||||
// A bound prefHeight alone is only ever a request — TreeView's own default max height stays
|
||||
// unconstrained, but nothing stops an ancestor from giving it less than that and letting its own
|
||||
// internal ScrollBar pick up the difference instead. Pinning min/max to it is what actually forces
|
||||
// the tree to grow (never scroll internally): NavigationSidebar's own outer ScrollPane, wrapped
|
||||
// around the whole destination list, is meant to be the only one that ever does.
|
||||
tree.setMinHeight(Region.USE_PREF_SIZE);
|
||||
tree.setMaxHeight(Region.USE_PREF_SIZE);
|
||||
// The tree fills the drawer, which already has its own border; EDGE_TO_EDGE drops the control's
|
||||
// so the two do not stack into a double line.
|
||||
tree.getStyleClass().add(Tweaks.EDGE_TO_EDGE);
|
||||
|
||||
Reference in New Issue
Block a user