Skip to content
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

IEP-1382 GH #1093: Drag the window to change the size but not in the expectation. #1108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ private void createProjectTargetSelection(Composite container)
{
Composite mainComposite = new Composite(container, SWT.NONE);
mainComposite.setLayout(new GridLayout(2, false));
GridData gridData = new GridData(GridData.FILL_BOTH);
gridData.horizontalSpan = 20;
gridData.verticalSpan = 5;
mainComposite.setLayoutData(gridData);
mainComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
Label label = new Label(mainComposite, SWT.NONE);
label.setText(Messages.NewProjectTargetSelection_Label);
EspConfigParser parser = new EspConfigParser();
Expand All @@ -91,7 +88,7 @@ private void createProjectNameGroup(Composite container)
{
Composite mainComposite = new Composite(container, SWT.NONE);
mainComposite.setLayout(new GridLayout());
GridData gridData = new GridData(GridData.FILL_BOTH);
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
gridData.horizontalSpan = 20;
gridData.verticalSpan = 5;

Comment on lines +91 to 94
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Replace fixed spans with fill-based layout

Using fixed span values (20, 5) can cause layout issues when resizing the window. Consider using a fill-based approach instead.

-		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
-		gridData.horizontalSpan = 20;
-		gridData.verticalSpan = 5;
+		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
gridData.horizontalSpan = 20;
gridData.verticalSpan = 5;
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);

Expand All @@ -106,7 +103,7 @@ private void createProjectNameGroup(Composite container)
projectNameLabel.setText(IDEWorkbenchMessages.WizardNewProjectCreationPage_nameLabel);

projectNameField = new Text(projectNameGroup, SWT.BORDER);
projectNameField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
projectNameField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
projectNameField.addModifyListener(new ModifyListener()
{
@Override
Expand Down
Loading