Skip to content

Commit cd6224c

Browse files
committed
Redesign Message Dialog
Removes unwanted space and aligns message content & buttons to center Fixes : #2929
1 parent e6eb975 commit cd6224c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

+4-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
@@ -105,7 +105,7 @@ protected Control createMessageArea(Composite composite) {
105105
.align(SWT.FILL, SWT.BEGINNING)
106106
.grab(true, false)
107107
.hint(
108-
convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH),
108+
SWT.DEFAULT,
109109
SWT.DEFAULT).applyTo(messageLabel);
110110
}
111111
return composite;
@@ -156,7 +156,7 @@ public void getName(AccessibleEvent event) {
156156
* @since 3.0
157157
*/
158158
protected int getMessageLabelStyle() {
159-
return SWT.WRAP;
159+
return SWT.CENTER;
160160
}
161161

162162
/*
@@ -169,7 +169,7 @@ protected Control createButtonBar(Composite parent) {
169169
// by createButton
170170
.equalWidth(true).applyTo(composite);
171171

172-
GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).span(2, 1)
172+
GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).span(2, 1)
173173
.applyTo(composite);
174174
composite.setFont(parent.getFont());
175175
// Add the buttons to the button bar.

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2016 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
@@ -327,8 +327,8 @@ protected Control createDialogArea(Composite parent) {
327327
layout.marginHeight = 0;
328328
layout.marginWidth = 0;
329329
composite.setLayout(layout);
330-
GridData data = new GridData(GridData.FILL_BOTH);
331-
data.horizontalSpan = 2;
330+
GridData data = new GridData(GridData.CENTER);
331+
data.horizontalSpan = 1;
332332
composite.setLayoutData(data);
333333
// allow subclasses to add custom controls
334334
customArea = createCustomArea(composite);
@@ -364,7 +364,7 @@ protected Button getButton(int index) {
364364
* @return the minimum message area width (in pixels)
365365
*/
366366
protected int getMinimumMessageWidth() {
367-
return convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
367+
return SWT.DEFAULT;
368368
}
369369

370370
/**

0 commit comments

Comments
 (0)