From 38897fbd2a763c349187cb1ea4e76eedaeccf914 Mon Sep 17 00:00:00 2001 From: Burning_TNT <88144530+burningtnt@users.noreply.github.com> Date: Thu, 23 Jan 2025 13:51:55 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20#3063=20=E4=BF=AE=E5=A4=8D=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E6=A8=A1=E7=BB=84=E7=AE=A1=E7=90=86=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=B0=B4=E5=B9=B3=E6=BB=9A=E5=8A=A8=E6=9D=A1=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98=20(#3463)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/jackhuang/hmcl/ui/construct/MDListCell.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MDListCell.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MDListCell.java index fe2f3263f..156e62d12 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MDListCell.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MDListCell.java @@ -18,6 +18,7 @@ package org.jackhuang.hmcl.ui.construct; import com.jfoenix.controls.JFXListView; +import javafx.beans.binding.DoubleBinding; import javafx.css.PseudoClass; import javafx.scene.control.ListCell; import javafx.scene.layout.Region; @@ -45,9 +46,11 @@ public abstract class MDListCell extends ListCell { Region clippedContainer = (Region) listView.lookup(".clipped-container"); setPrefWidth(0); if (clippedContainer != null) { - maxWidthProperty().bind(clippedContainer.widthProperty()); - prefWidthProperty().bind(clippedContainer.widthProperty()); - minWidthProperty().bind(clippedContainer.widthProperty()); + DoubleBinding converted = clippedContainer.widthProperty().subtract(1); + + maxWidthProperty().bind(converted); + prefWidthProperty().bind(converted); + minWidthProperty().bind(converted); } }