-
Notifications
You must be signed in to change notification settings - Fork 209
Redesign Message Dialog #2934
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
base: master
Are you sure you want to change the base?
Redesign Message Dialog #2934
Conversation
As the discussion on the bug reveals, there is no obvious consensus to find between aligned left vs centered; however, all OSs recommend to get the width fit the content (ie no extra space), so I think for a first iteration, we should focus on just saving the extra space (changing the min width to 0 or DEFAULT), and consider whether to center or not later; maybe if all OSs align on the same recommendation some day. |
cd6224c
to
f549998
Compare
f549998
to
0100808
Compare
Made minor adjustment for these cases |
Removed unnecessary spacing in the message dialog to improve visual alignment and create a more compact, cleaner layout. Fixes : eclipse-platform#2929
0100808
to
1db3a95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think changing the horizontalSpan is a bad idea. I'm not even sure why it's needed.
@@ -328,7 +328,6 @@ protected Control createDialogArea(Composite parent) { | |||
layout.marginWidth = 0; | |||
composite.setLayout(layout); | |||
GridData data = new GridData(GridData.FILL_BOTH); | |||
data.horizontalSpan = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -100,13 +100,14 @@ protected Control createMessageArea(Composite composite) { | |||
if (message != null) { | |||
messageLabel = new Label(composite, getMessageLabelStyle()); | |||
messageLabel.setText(message); | |||
int minWidthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH - 50); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's odd to compute this in advance and then only use it conditionally later.
convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), | ||
SWT.DEFAULT).applyTo(messageLabel); | ||
.indent(5, 0) | ||
.hint(message.length() > 40 ? minWidthHint : SWT.DEFAULT, SWT.DEFAULT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The number 40 is quite magic. I wonder how things like font size and scaling might affect what this number should be?
Removes unwanted space and aligns message content & buttons to center
Before

After
Fixes : #2929