Fix: Limit offline account skin dialog height#6231
Conversation
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request scales the OfflineAccountSkinPane to 85% on both axes before displaying it in a dialog. The review feedback correctly identifies that using setScaleX and setScaleY is a JavaFX anti-pattern because it does not affect layout bounds and can cause blurry rendering, and suggests using layout constraints like setMaxHeight instead.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| pane.setScaleX(0.85); | ||
| pane.setScaleY(0.85); |
There was a problem hiding this comment.
Using setScaleX and setScaleY in JavaFX is an anti-pattern for controlling layout size.
Why this is an issue:
- Layout Bounds Unchanged: Visual scaling via
setScaledoes not affect the node'slayoutBounds. The parent dialog container will still allocate space for the unscaled size, meaning the dialog window itself will still be excessively tall, leaving large empty margins around the scaled content. - Blurry Rendering: Scaling vector UI controls and text by a non-integer factor (like
0.85) disables subpixel rendering alignment, making text, borders, and buttons look blurry and pixelated.
Recommended Solution:
Limit the dialog's height using layout constraints instead, such as setting a maximum height (setMaxHeight) on the pane, which the parent dialog container will respect during layout.
| pane.setScaleX(0.85); | |
| pane.setScaleY(0.85); | |
| pane.setMaxHeight(550); |
修复
OfflineAccountSkinPane占用的高度问题缘由
OfflineAccountSkinPane由Controllers.dialog()进行调用,在其内容过多的情况下,可能占满整个窗口的高度,且注意到DecoratorSkin(行254至260)中使用了如下语句,这会让标题栏右侧按钮保持在前。更改
setScaleX()和setScaleY对OfflineAccountSkinPane进行缩放以限制高度。实况