修列表滚动:ScrollPane 的 (boolean,boolean) 方法是 setScrollingDisabled 不是 setForceScroll;上一版传 (false,true) 把纵向滚动关掉了,现改为 (false,false) 恢复双向滚动

This commit is contained in:
tianmo committed 2026-10-16 16:13:09 +08:00
1 parent 320f537a60
commit 8d396ecb5b
1 file changed
+5 -3
+5 -3
View File
@@ -542,17 +542,19 @@ public final class ObjectPanel {
// 同上
}
try {
// ScrollPane.setForceScroll(boolean, boolean):让它按新的内容高度重算可滚动范围
// ⚠️ ScrollPane 上这个 (boolean,boolean) 方法是 **setScrollingDisabled(x, y)**(指纹表已确认),
// 不是 setForceScroll —— 传 (false,true) 会把纵向滚动**关掉**,看起来就是"列表滚不动"。
// 这里显式恢复:两个方向都可以滚。
for (Method method : state.listScroll.getClass().getMethods()) {
Class<?>[] types = method.getParameterTypes();
if (types.length != 2 || types[0] != boolean.class || types[1] != boolean.class) continue;
if (method.getReturnType() != void.class) continue;
method.setAccessible(true);
method.invoke(state.listScroll, Boolean.FALSE, Boolean.TRUE);
method.invoke(state.listScroll, Boolean.FALSE, Boolean.FALSE);
break;
}
} catch (Throwable error) {
System.err.println("[panel] 重算滚动范围失败: " + error);
System.err.println("[panel] 恢复滚动失败: " + error);
}
}