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

Bug 330334

Summary: [Button (CHECK)] Improve computeSize implementation for the case there is no Image / Text
Product: [RT] RAP Reporter: Istvan Ballok <Istvan.Ballok>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.4   
Target Milestone: 1.4 M4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
proposed patch ivan: iplog+

Description Istvan Ballok CLA 2010-11-16 05:38:32 EST
Improve the computeSize implementation in the Button.java class for the case 
- there is no Image and Text, and 
- the Button is of type SWT.CHECK

ie. 
- add the spacing to the width (that serves to separate the check symbol and the text / image) only if there is a text or image.
- if there is no text and image, do not initialise the width with 1 (I couldn't find any usecase for that); 0 is appropriate
Comment 1 Istvan Ballok CLA 2010-11-16 05:44:53 EST
Created attachment 183208 [details]
proposed patch

- add a checkbox without text and image to the demo, to show the problem.
- improve the computesize implementation
Comment 2 Ivan Furnadjiev CLA 2010-11-19 04:24:21 EST
Istvan, thanks for the patch. Applied patch to CVS HEAD. Button JUnit tests adjusted too.