Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 183208 Details for
Bug 330334
[Button (CHECK)] Improve computeSize implementation for the case there is no Image / Text
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
proposed patch
330334_button_computesize_1.3_CAS.patch (text/plain), 3.83 KB, created by
Istvan Ballok
on 2010-11-16 05:44:53 EST
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Istvan Ballok
Created:
2010-11-16 05:44:53 EST
Size:
3.83 KB
patch
obsolete
>commit 899d65ee0748f440509291e48d268a943eac83f4 >tree 597a70421bea0fa1fe5a5650a049930a9b1f9af3 >parent f61f8871293c87d6c21bcbad9a6455d9738c424a >author Istvan Ballok <Istvan.Ballok@cas.de> 1289904269 +0100 >committer Istvan Ballok <Istvan.Ballok@cas.de> 1289904269 +0100 > > bug 330334 [Button (CHECK)] Improve computeSize implementation for the case there is no Image / Text > > Proposed patch to improve the #computeSize implementation > > --- > > 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 > >diff --git a/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Button.java b/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Button.java >index f84aefe..fd50099 100644 >--- a/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Button.java >+++ b/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Button.java >@@ -391,9 +391,6 @@ public class Button extends Control { > width += extent.x; > height = Math.max( height, extent.y ); > } >- if( width == 0 ) { >- width = 1; >- } > if( height == 0 ) { > height = 10; > } >@@ -405,7 +402,10 @@ public class Button extends Control { > } > if( ( style & ( SWT.CHECK | SWT.RADIO ) ) != 0 ) { > Point checkSize = themeAdapter.getCheckSize( this ); >- width += checkSize.x + themeAdapter.getCheckSpacing( this ); >+ width += checkSize.x; >+ if (hasText || hasImage) { >+ width += themeAdapter.getCheckSpacing( this ); >+ } > height = Math.max( height, checkSize.y ); > } > Rectangle padding = themeAdapter.getPadding( this ); > >commit f61f8871293c87d6c21bcbad9a6455d9738c424a >tree c9e8c832a0ecd570e95dc87fa9cc4a5759b3d8c9 >parent a4be93171d83f1b6463bcac92f224f680c0043da >author Istvan Ballok <Istvan.Ballok@cas.de> 1289904168 +0100 >committer Istvan Ballok <Istvan.Ballok@cas.de> 1289904168 +0100 > > bug 330334 [Button (CHECK)] Improve computeSize implementation for the case there is no Image / Text > > Patch to reproduce the problem. > > --- > > 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 > >diff --git a/runtime.ui/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ButtonTab.java b/runtime.ui/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ButtonTab.java >index 95acc37..773a394 100644 >--- a/runtime.ui/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ButtonTab.java >+++ b/runtime.ui/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ButtonTab.java >@@ -43,6 +43,8 @@ public class ButtonTab extends ExampleTab { > private Button radioButton3; > private Button defaultButton; > >+ private Button checkButton3; >+ > public ButtonTab( final CTabFolder folder ) { > super( folder, "Button" ); > } >@@ -85,6 +87,7 @@ public class ButtonTab extends ExampleTab { > checkButton2.setText( "Check with image" ); > createButtonImage( parent.getDisplay() ); > checkButton2.setImage( buttonImage ); >+ checkButton3 = new Button( parent, style | SWT.CHECK ); > radioButton1 = new Button( parent, style | SWT.RADIO ); > radioButton1.setText( "Radio 1" ); > radioButton2 = new Button( parent, style | SWT.RADIO );
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ivan
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 330334
: 183208