fix: 任务窗口速度与取消未对齐#6140
Conversation
CiiLu
commented
May 24, 2026
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
/gemini review |
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the layout of the TaskExecutorDialogPane by replacing a BorderPane with an HBox at the bottom of the dialog, cleaning up imports, and using a spacer region to push the cancel button to the right. The review feedback suggests avoiding wildcard imports for javafx.scene.layout to comply with the Google Java Style Guide, and recommends binding the visibility and managed properties of lblProgress to its text content to prevent layout issues when the progress label is empty.
| lblProgress = new Label(); | ||
| bottom.setLeft(lblProgress); | ||
|
|
||
| Region spacer = new Region(); |
There was a problem hiding this comment.
当 lblProgress 的文本为空时(例如在任务刚开始或非下载任务中),由于它默认是可见且参与布局的,HBox 仍会为其保留位置并应用 spacing(8)。这会导致左侧出现额外的 8 像素间距,从而破坏整体的对齐效果。
建议将 lblProgress 的 visible 和 managed 属性与其文本是否为空进行绑定。这样当文本为空时,它不会占用任何布局空间,也不会产生多余的间距。
| lblProgress = new Label(); | |
| bottom.setLeft(lblProgress); | |
| Region spacer = new Region(); | |
| lblProgress = new Label(); | |
| lblProgress.visibleProperty().bind(lblProgress.textProperty().isNotEmpty()); | |
| lblProgress.managedProperty().bind(lblProgress.visibleProperty()); | |
| Region spacer = new Region(); |