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