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 142351 Details for
Bug 284378
[Button] Optimization of CHECK and RADIO buttons
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
Bug284378-patch.txt (text/plain), 9.46 KB, created by
Asen Draganov
on 2009-07-23 03:37:38 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Asen Draganov
Created:
2009-07-23 03:37:38 EDT
Size:
9.46 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: src/org/eclipse/swt/internal/widgets/buttonkit/ButtonThemeAdapter.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/internal/widgets/buttonkit/ButtonThemeAdapter.java,v >retrieving revision 1.21 >diff -u -r1.21 ButtonThemeAdapter.java >--- src/org/eclipse/swt/internal/widgets/buttonkit/ButtonThemeAdapter.java 21 Jul 2009 10:48:55 -0000 1.21 >+++ src/org/eclipse/swt/internal/widgets/buttonkit/ButtonThemeAdapter.java 23 Jul 2009 07:12:32 -0000 >@@ -22,7 +22,6 @@ > public final class ButtonThemeAdapter extends ControlThemeAdapter { > > private static final Point CHECK_SIZE = new Point( 13, 13 ); >- private static final int CHECK_SPACING = 4; > > protected void configureMatcher( final WidgetMatcher matcher ) { > super.configureMatcher( matcher ); >@@ -41,10 +40,6 @@ > return getCssDimension( "Button", "spacing", button ); > } > >- public int getCheckSpacing( final Button button ) { >- return CHECK_SPACING; >- } >- > public Point getCheckSize( final Button button ) { > return CHECK_SIZE; > } >Index: src/org/eclipse/swt/widgets/Button.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/Button.java,v >retrieving revision 1.23 >diff -u -r1.23 Button.java >--- src/org/eclipse/swt/widgets/Button.java 21 Jul 2009 10:48:55 -0000 1.23 >+++ src/org/eclipse/swt/widgets/Button.java 23 Jul 2009 07:12:32 -0000 >@@ -400,7 +400,7 @@ > } > if( ( style & ( SWT.CHECK | SWT.RADIO ) ) != 0 ) { > Point checkSize = themeAdapter.getCheckSize( this ); >- width += checkSize.x + themeAdapter.getCheckSpacing( this ); >+ width += checkSize.x + themeAdapter.getSpacing( this ); > height = Math.max( height, checkSize.y ); > } > Rectangle padding = themeAdapter.getPadding( this ); >#P org.eclipse.rap.rwt.q07 >Index: js/org/eclipse/swt/widgets/RadioButton.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/js/org/eclipse/swt/widgets/RadioButton.js,v >retrieving revision 1.11 >diff -u -r1.11 RadioButton.js >--- js/org/eclipse/swt/widgets/RadioButton.js 21 Jul 2009 10:48:53 -0000 1.11 >+++ js/org/eclipse/swt/widgets/RadioButton.js 23 Jul 2009 07:12:42 -0000 >@@ -22,8 +22,6 @@ > > // Default values > this._selection = false; >- this._text = ""; >- this._image = null; > this._hasSelectionListener = false; > > // RadioButton icon >@@ -31,13 +29,18 @@ > this._icon.setAppearance( "radio-button-icon" ); > this.add( this._icon ); > >- // RadioButton content - image and text >- this._content = new qx.ui.basic.Atom( "(empty)", this._image ); >- this._content.getLabelObject().setAppearance( "label-graytext" ); >- this._content.setLabel( this._text ); >- this._content.setHorizontalChildrenAlign( "center" ); >- this._content.setVerticalChildrenAlign( "middle" ); >- this.add( this._content ); >+ // RadioButton image >+ this._image = new qx.ui.basic.Image; >+ this._image.setDisplay( false ); >+ this.add( this._image ); >+ >+ // RadioButton text >+ this._text = new qx.ui.basic.Label; >+ this._text.setAppearance( "label-graytext" ); >+ this._text.setText( "" ); >+ this._text.setCursor( "default" ); >+ this._text.setDisplay( false ); >+ this.add( this._text ); > > // Add events listeners > this.addEventListener( "contextmenu", this._onContextMenu, this ); >@@ -55,7 +58,7 @@ > this.removeEventListener( "mouseout", this._onmouseout ); > this.removeEventListener( "keyup", this._onkeyup ); > this.removeEventListener( "keypress", this._onkeypress ); >- this._disposeObjects( "_icon", "_content" ); >+ this._disposeObjects( "_icon", "_image", "_text" ); > }, > > members : { >@@ -72,9 +75,11 @@ > _applyCursor : function( value, old ) { > this.base( arguments, value, old ); > if( value ) { >- this._content.setCursor( value ); >+ this._image.setCursor( value ); >+ this._text.setCursor( value ); > } else { >- this._content.resetCursor(); >+ this._image.resetCursor(); >+ this._text.setCursor( "default" ); > } > }, > >@@ -176,17 +181,21 @@ > }, > > setLabel : function( value ) { >- this._text = value; >- this._content.setLabel( value ); >+ this._text.setText( value ); >+ if( value != "" ) { >+ this._text.setDisplay( true ); >+ } > }, > > setIcon : function( value ) { >- this._image = value; >- this._content.setIcon( value ); >+ this._image.setSource( value ); >+ if( value ) { >+ this._image.setDisplay( true ); >+ } > }, > > setHorizontalChildrenAlign : function( value ) { >- this._content.setHorizontalChildrenAlign( value ); >+ this._text.setTextAlign( value ); > }, > > setSelection : function( value ) { >Index: js/org/eclipse/swt/widgets/CheckBox.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/js/org/eclipse/swt/widgets/CheckBox.js,v >retrieving revision 1.9 >diff -u -r1.9 CheckBox.js >--- js/org/eclipse/swt/widgets/CheckBox.js 21 Jul 2009 10:48:53 -0000 1.9 >+++ js/org/eclipse/swt/widgets/CheckBox.js 23 Jul 2009 07:12:42 -0000 >@@ -23,22 +23,25 @@ > // Default values > this._selected = false; > this._grayed = false; >- this._text = ""; >- this._image = null; > this._hasSelectionListener = false; > > // CheckButton icon > this._icon = new qx.ui.basic.Image; > this._icon.setAppearance( "check-box-icon" ); > this.add( this._icon ); >- >- // CheckButton content - image and text >- this._content = new qx.ui.basic.Atom( "(empty)", this._image ); >- this._content.getLabelObject().setAppearance( "label-graytext" ); >- this._content.setLabel( this._text ); >- this._content.setHorizontalChildrenAlign( "center" ); >- this._content.setVerticalChildrenAlign( "middle" ); >- this.add( this._content ); >+ >+ // CheckButton image >+ this._image = new qx.ui.basic.Image; >+ this._image.setDisplay( false ); >+ this.add( this._image ); >+ >+ // CheckButton text >+ this._text = new qx.ui.basic.Label; >+ this._text.setAppearance( "label-graytext" ); >+ this._text.setText( "" ); >+ this._text.setCursor( "default" ); >+ this._text.setDisplay( false ); >+ this.add( this._text ); > > // Add events listeners > this.addEventListener( "contextmenu", this._onContextMenu, this ); >@@ -54,7 +57,7 @@ > this.removeEventListener( "mouseover", this._onmouseover ); > this.removeEventListener( "mouseout", this._onmouseout ); > this.removeEventListener( "keyup", this._onkeyup ); >- this._disposeObjects( "_icon", "_content" ); >+ this._disposeObjects( "_icon", "_image", "_text" ); > }, > > members : { >@@ -84,9 +87,11 @@ > _applyCursor : function( value, old ) { > this.base( arguments, value, old ); > if( value ) { >- this._content.setCursor( value ); >+ this._image.setCursor( value ); >+ this._text.setCursor( value ); > } else { >- this._content.resetCursor(); >+ this._image.resetCursor(); >+ this._text.setCursor( "default" ); > } > }, > >@@ -118,17 +123,21 @@ > }, > > setLabel : function( value ) { >- this._text = value; >- this._content.setLabel( value ); >+ this._text.setText( value ); >+ if( value != "" ) { >+ this._text.setDisplay( true ); >+ } > }, > > setIcon : function( value ) { >- this._image = value; >- this._content.setIcon( value ); >+ this._image.setSource( value ); >+ if( value ) { >+ this._image.setDisplay( true ); >+ } > }, > > setHorizontalChildrenAlign : function( value ) { >- this._content.setHorizontalChildrenAlign( value ); >+ this._text.setTextAlign( value ); > }, > > setSelection : function( value ) { >Index: js/org/eclipse/swt/theme/AppearancesBase.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/js/org/eclipse/swt/theme/AppearancesBase.js,v >retrieving revision 1.121 >diff -u -r1.121 AppearancesBase.js >--- js/org/eclipse/swt/theme/AppearancesBase.js 21 Jul 2009 20:47:03 -0000 1.121 >+++ js/org/eclipse/swt/theme/AppearancesBase.js 23 Jul 2009 07:12:42 -0000 >@@ -237,7 +237,7 @@ > backgroundColor : tv.getCssColor( "Button", "background-color" ), > backgroundImage : tv.getCssImage( "Button", "background-image" ), > backgroundGradient : tv.getCssGradient( "Button", "background-image" ), >- spacing : 4, >+ spacing : tv.getCssDimension( "Button", "spacing" ), > padding : tv.getCssBoxDimensions( "Button", "padding" ) > } > } >@@ -270,7 +270,7 @@ > backgroundColor : tv.getCssColor( "Button", "background-color" ), > backgroundImage : tv.getCssImage( "Button", "background-image" ), > backgroundGradient : tv.getCssGradient( "Button", "background-image" ), >- spacing : 4, >+ spacing : tv.getCssDimension( "Button", "spacing" ), > padding : tv.getCssBoxDimensions( "Button", "padding" ) > } > }
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
Actions:
View
|
Diff
Attachments on
bug 284378
: 142351