@@ -433,6 +433,20 @@ public final class FXUtils {
|
||||
return pane;
|
||||
}
|
||||
|
||||
public static void limitCellWidth(ListView<?> listView, ListCell<?> cell) {
|
||||
ReadOnlyDoubleProperty widthProperty;
|
||||
|
||||
if (listView.lookup(".clipped-container") instanceof Region clippedContainer) {
|
||||
widthProperty = clippedContainer.widthProperty();
|
||||
} else {
|
||||
widthProperty = listView.widthProperty();
|
||||
}
|
||||
|
||||
cell.maxWidthProperty().bind(widthProperty);
|
||||
cell.prefWidthProperty().bind(widthProperty);
|
||||
cell.minWidthProperty().bind(widthProperty);
|
||||
}
|
||||
|
||||
public static void smoothScrolling(ScrollPane scrollPane) {
|
||||
if (AnimationUtils.isAnimationEnabled())
|
||||
ScrollUtils.addSmoothScrolling(scrollPane);
|
||||
|
||||
@@ -189,6 +189,7 @@ public final class JavaManagementPage extends ListPageBase<JavaRuntime> {
|
||||
|
||||
JavaPageSkin(JavaManagementPage skinnable) {
|
||||
super(skinnable);
|
||||
this.listView.getStyleClass().add("no-horizontal-scrollbar");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -210,7 +211,7 @@ public final class JavaManagementPage extends ListPageBase<JavaRuntime> {
|
||||
|
||||
@Override
|
||||
protected ListCell<JavaRuntime> createListCell(JFXListView<JavaRuntime> listView) {
|
||||
return new JavaItemCell();
|
||||
return new JavaItemCell(listView);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,7 +223,7 @@ public final class JavaManagementPage extends ListPageBase<JavaRuntime> {
|
||||
private final StackPane removeIconPane;
|
||||
private final Tooltip removeTooltip = new Tooltip();
|
||||
|
||||
JavaItemCell() {
|
||||
JavaItemCell(JFXListView<JavaRuntime> listView) {
|
||||
BorderPane root = new BorderPane();
|
||||
|
||||
HBox center = new HBox();
|
||||
@@ -272,6 +273,8 @@ public final class JavaManagementPage extends ListPageBase<JavaRuntime> {
|
||||
root.setPadding(new Insets(8));
|
||||
|
||||
this.graphic = new RipplerContainer(root);
|
||||
|
||||
FXUtils.limitCellWidth(listView, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -558,11 +558,8 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP
|
||||
|
||||
setPrefWidth(0);
|
||||
|
||||
if (listView.lookup(".clipped-container") instanceof Region clippedContainer) {
|
||||
maxWidthProperty().bind(clippedContainer.widthProperty());
|
||||
prefWidthProperty().bind(clippedContainer.widthProperty());
|
||||
minWidthProperty().bind(clippedContainer.widthProperty());
|
||||
}
|
||||
FXUtils.limitCellWidth(listView, this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -955,6 +955,13 @@
|
||||
-fx-background-color: transparent;
|
||||
}
|
||||
|
||||
.no-horizontal-scrollbar .scroll-bar:horizontal {
|
||||
-fx-opacity: 0;
|
||||
-fx-max-height: 0;
|
||||
-fx-min-height: 0;
|
||||
-fx-pref-height: 0;
|
||||
}
|
||||
|
||||
.options-list {
|
||||
-fx-background-color: transparent;
|
||||
-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.26), 5, 0.06, -0.5, 1);
|
||||
|
||||
Reference in New Issue
Block a user