Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330334 - [Button (CHECK)] Improve computeSize implementation for the case there is no Image / Text
Summary: [Button (CHECK)] Improve computeSize implementation for the case there is no ...
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.4 M4   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-16 05:38 EST by Istvan Ballok CLA
Modified: 2010-11-19 04:24 EST (History)
0 users

See Also:


Attachments
proposed patch (3.83 KB, patch)
2010-11-16 05:44 EST, Istvan Ballok CLA
ivan: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.