Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 491949

Summary: [Smart project import] Buttons in wizard should have the same width
Product: [Eclipse Project] Platform Reporter: Rüdiger Herrmann <ruediger.herrmann>
Component: UIAssignee: Rüdiger Herrmann <ruediger.herrmann>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: Lars.Vogel, mistria, psuzzi, ruediger.herrmann
Version: 4.6   
Target Milestone: 4.6 M7   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/70960
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=a13473aeb156855d65ef648453ece233c88ad337
https://git.eclipse.org/r/71131
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=5ad5a234eb34a4e739af9e7073386c0145e44852
Whiteboard:
Attachments:
Description Flags
Screenshot none

Description Rüdiger Herrmann CLA 2016-04-18 19:11:08 EDT
Usually, dialog buttons in Eclipse have the same width. See the 'Import existing projects' wizard for an example.

Please adjust the width of the [Directory], [Archive], [Select All] and [Deselect All] buttons to have the same width as [New] and [Select]

Assuming that a GridLayout is used, using LayoutConstants::getMinButtonSize() as a widthHint usually achieves good results.
Comment 1 Lars Vogel CLA 2016-04-19 02:14:32 EDT
Rüdiger, for which import wizard is this? Can you upload a Gerrit review for the fix?
Comment 2 Rüdiger Herrmann CLA 2016-04-19 09:10:38 EDT
(In reply to Lars Vogel from comment #1)
> Rüdiger, for which import wizard is this? 

This bug is about the Smart project import wizard
Comment 3 Eclipse Genie CLA 2016-04-19 09:36:43 EDT
New Gerrit change created: https://git.eclipse.org/r/70960
Comment 5 Mickael Istria CLA 2016-04-19 11:48:51 EDT
Thanks Rudiger!
Comment 6 Lars Vogel CLA 2016-04-21 06:19:41 EDT
Created attachment 261145 [details]
Screenshot

This breaks the height of the button under Ubuntu 15.10. Please fix or revert.
Comment 7 Lars Vogel CLA 2016-04-21 06:20:19 EDT
.
Comment 8 Eclipse Genie CLA 2016-04-21 07:38:49 EDT
New Gerrit change created: https://git.eclipse.org/r/71131
Comment 9 Rüdiger Herrmann CLA 2016-04-21 07:44:22 EDT
(In reply to Lars Vogel from comment #6)
> Created attachment 261145 [details]
> Screenshot
> 
> This breaks the height of the button under Ubuntu 15.10. Please fix or
> revert.

Isn't this actually an SWT bug and should also be reported there?

However, to work around the issue in the meanwhile, I've uploaded this change:
  https://git.eclipse.org/r/71131

The changed code uses DialogPage::setButtonLayoutData() to make the buttons look good. It works on Windows but lacking a Linux install, I can't tell for Ubuntu.
Comment 10 Lars Vogel CLA 2016-04-21 07:49:04 EDT
(In reply to Rüdiger Herrmann from comment #9)
> Isn't this actually an SWT bug and should also be reported there?

Please create a bug with a small snippet for the SWT team.

> I can't tell for Ubuntu.

Looks good on Ubuntu

Thanks for the fast reaction Rüdiger
Comment 11 Rüdiger Herrmann CLA 2016-04-21 10:02:13 EDT
(In reply to Lars Vogel from comment #10)
> (In reply to Rüdiger Herrmann from comment #9)
> > Isn't this actually an SWT bug and should also be reported there?
> 
> Please create a bug with a small snippet for the SWT team.

It turns out that LayoutConstants::getMinButtonSize() always returns a height of zero. See bug 492181.

> 
> > I can't tell for Ubuntu.
> 
> Looks good on Ubuntu
> Thanks for the fast reaction Rüdiger

Thanks for verifying.