Skip to content

Commit e8c7042

Browse files
committed
Make message dialog more compact
Removed unnecessary spacing in the message dialog to improve visual alignment and create a more compact, cleaner layout. Fixes : #2929
1 parent d4ffd3f commit e8c7042

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IconAndMessageDialog.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2015 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -100,13 +100,15 @@ protected Control createMessageArea(Composite composite) {
100100
if (message != null) {
101101
messageLabel = new Label(composite, getMessageLabelStyle());
102102
messageLabel.setText(message);
103+
int xHint = message.length() > 40
104+
? convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH)
105+
: convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH - 50);
103106
GridDataFactory
104107
.fillDefaults()
105108
.align(SWT.FILL, SWT.BEGINNING)
106109
.grab(true, false)
107-
.hint(
108-
convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH),
109-
SWT.DEFAULT).applyTo(messageLabel);
110+
.hint(xHint, SWT.DEFAULT)
111+
.applyTo(messageLabel);
110112
}
111113
return composite;
112114
}

0 commit comments

Comments
 (0)