Skip to content

fix(ui): refine PromptDialogPane #3693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

3gf8jv4dv
Copy link
Contributor

@3gf8jv4dv 3gf8jv4dv commented Mar 3, 2025

  • Limit the dialog width to avoid too long a width
  • Avoid accidental blank line in the information box (That blue bg box)
Preview
Before After
image-1 image-2
image-3 image-4
image-5 image-6

- Limit the dialog width to avoid too long a width
- Avoid accidental blank line in the information box (That blue bg box)
@@ -49,6 +49,7 @@ public class PromptDialogPane extends DialogPane {
public PromptDialogPane(Builder builder) {
this.builder = builder;
setTitle(builder.title);
setPrefWidth(560);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请避免使用魔数。可使用 org.jackhuang.hmcl.ui.Controllers#MIN_HEIGHT 的计算和 org.jackhuang.hmcl.ui.Controllers.getStage().widthProperty() 的绑定

@Glavo Glavo requested a review from Copilot May 29, 2025 11:20
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refines the PromptDialogPane UI to improve layout and avoid unintended blank space. Key changes include setting a fixed preferred width and updating GridPane column spans for various UI components.

@@ -49,6 +49,7 @@ public class PromptDialogPane extends DialogPane {
public PromptDialogPane(Builder builder) {
this.builder = builder;
setTitle(builder.title);
setPrefWidth(560);
Copy link
Preview

Copilot AI May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The value '560' is used directly as a magic number. Consider extracting it as a named constant or configuration parameter to enhance maintainability.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants