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 141149 Details for
Bug 282903
[Theming] Cleanup border-radius implementation
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.
Bug-282903.patch (text/plain), 8.62 KB, created by
Ivan Furnadjiev
on 2009-07-08 21:52:22 EDT
(
hide
)
Description:
Proposed patch.
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2009-07-08 21:52:22 EDT
Size:
8.62 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt.test >Index: src/org/eclipse/rwt/internal/theme/css/StyleSheet_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/rwt/internal/theme/css/StyleSheet_Test.java,v >retrieving revision 1.9 >diff -u -r1.9 StyleSheet_Test.java >--- src/org/eclipse/rwt/internal/theme/css/StyleSheet_Test.java 6 Jul 2009 10:34:22 -0000 1.9 >+++ src/org/eclipse/rwt/internal/theme/css/StyleSheet_Test.java 9 Jul 2009 01:46:00 -0000 >@@ -14,7 +14,6 @@ > import junit.framework.TestCase; > > import org.eclipse.rwt.internal.theme.*; >-import org.eclipse.swt.graphics.Rectangle; > > > public class StyleSheet_Test extends TestCase { >@@ -68,19 +67,6 @@ > assertEquals( QxColor.create( 192, 192, 192 ), values[ 5 ].value ); > } > >- public void testMergeBorderRadius() throws Exception { >- StyleSheet styleSheet = ThemeTestUtil.getStyleSheet( TEST_EXAMPLE_CSS ); >- ConditionalValue[] values = styleSheet.getValues( "Composite", "border" ); >-// assertEquals( 1, values.length ); >- assertEquals( "[BORDER", join( values[ 0 ].constraints ) ); >- QxBorder expected = QxBorder.create( 2, "solid", "#1695d4" ); >- expected.radius = new Rectangle( 5, 10, 5, 10 ); >- assertEquals( expected, values[ 0 ].value ); >- values = styleSheet.getValues( "Composite", "border-radius" ); >- assertEquals( "[BORDER", join( values[ 0 ].constraints ) ); >- assertEquals( QxBoxDimensions.create( 5, 10, 5, 10 ), values[ 0 ].value ); >- } >- > private static String join( final String[] array ) { > StringBuffer result = new StringBuffer(); > for( int i = 0; i < array.length; i++ ) { >#P org.eclipse.rap.rwt.q07 >Index: js/org/eclipse/swt/theme/ThemeValues.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/js/org/eclipse/swt/theme/ThemeValues.js,v >retrieving revision 1.14 >diff -u -r1.14 ThemeValues.js >--- js/org/eclipse/swt/theme/ThemeValues.js 6 Jul 2009 07:49:21 -0000 1.14 >+++ js/org/eclipse/swt/theme/ThemeValues.js 9 Jul 2009 01:46:01 -0000 >@@ -39,6 +39,16 @@ > var values = this._store.getThemeValues(); > var result = values.borders[ vkey ]; > this.__checkDefined( result, element, key ); >+ // construct rounded border if "border-radius" is set >+ var rkey = this._store.getCssValue( element, this._states, "border-radius" ); >+ var radius = values.boxdims[ rkey ]; >+ if( radius != null && result instanceof qx.ui.core.Border ) { >+ var width = result.getWidthTop(); >+ var color = result.getColorTop(); >+ result = new org.eclipse.rwt.RoundedBorder( width ); >+ result.setRadii( radius ); >+ result.setColor( color ); >+ } > return result; > }, > >Index: js/org/eclipse/swt/theme/ThemeStore.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/js/org/eclipse/swt/theme/ThemeStore.js,v >retrieving revision 1.22 >diff -u -r1.22 ThemeStore.js >--- js/org/eclipse/swt/theme/ThemeStore.js 6 Jul 2009 07:49:21 -0000 1.22 >+++ js/org/eclipse/swt/theme/ThemeStore.js 9 Jul 2009 01:46:01 -0000 >@@ -143,12 +143,7 @@ > } > } > if( border == null ) { >- if( value.radius ) { >- border = new org.eclipse.rwt.RoundedBorder( value.width ); >- border.setRadii( value.radius ); >- } else { >- border = new qx.ui.core.Border( value.width, value.style ); >- } >+ border = new qx.ui.core.Border( value.width, value.style ); > if( value.color ) { > border.setColor( value.color ); > } >#P org.eclipse.rap.rwt >Index: src/org/eclipse/rwt/internal/theme/QxBorder.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/theme/QxBorder.java,v >retrieving revision 1.11 >diff -u -r1.11 QxBorder.java >--- src/org/eclipse/rwt/internal/theme/QxBorder.java 6 Jul 2009 07:49:17 -0000 1.11 >+++ src/org/eclipse/rwt/internal/theme/QxBorder.java 9 Jul 2009 01:46:02 -0000 >@@ -11,8 +11,6 @@ > ******************************************************************************/ > package org.eclipse.rwt.internal.theme; > >-import org.eclipse.swt.graphics.Rectangle; >- > > public class QxBorder implements QxType { > >@@ -41,8 +39,6 @@ > // color theme. Check for valid colors. > public final String color; > >- public Rectangle radius; >- > private QxBorder( final int width, final String style, final String color ) { > this.width = width; > this.style = style; >@@ -145,10 +141,7 @@ > : style.equals( other.style ) ) > && ( color == null > ? other.color == null >- : color.equals( other.color ) ) >- && ( radius == null >- ? other.radius == null >- : radius.equals( other.radius ) ); >+ : color.equals( other.color ) ); > } > return result; > } >@@ -164,16 +157,13 @@ > if( color != null ) { > result += 37 * result + color.hashCode(); > } >- if( radius != null ) { >- result += 37 * result + radius.hashCode(); >- } > return result; > } > > public String toString() { > // TODO [rst] Adapt this method as soon as properties for left, right, etc. > // exist >- return "QxBorder{ " + width + ", " + style + ", " + color + ", " + radius + " }"; >+ return "QxBorder{ " + width + ", " + style + ", " + color + " }"; > } > > private static String parseStyle( final String part ) { >Index: src/org/eclipse/rwt/internal/theme/ThemeStoreWriter.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/theme/ThemeStoreWriter.java,v >retrieving revision 1.3 >diff -u -r1.3 ThemeStoreWriter.java >--- src/org/eclipse/rwt/internal/theme/ThemeStoreWriter.java 6 Jul 2009 07:49:17 -0000 1.3 >+++ src/org/eclipse/rwt/internal/theme/ThemeStoreWriter.java 9 Jul 2009 01:46:02 -0000 >@@ -105,14 +105,6 @@ > borderObject.append( "width", border.width ); > borderObject.append( "style", border.style ); > borderObject.append( "color", border.color ); >- if( border.radius != null ) { >- JsonArray boxArray = new JsonArray(); >- boxArray.append( border.radius.x ); >- boxArray.append( border.radius.y ); >- boxArray.append( border.radius.width ); >- boxArray.append( border.radius.height ); >- borderObject.append( "radius", boxArray ); >- } > borderMap.append( key, borderObject ); > } > } >Index: src/org/eclipse/rwt/internal/theme/css/StyleSheet.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/theme/css/StyleSheet.java,v >retrieving revision 1.13 >diff -u -r1.13 StyleSheet.java >--- src/org/eclipse/rwt/internal/theme/css/StyleSheet.java 8 Jul 2009 19:08:21 -0000 1.13 >+++ src/org/eclipse/rwt/internal/theme/css/StyleSheet.java 9 Jul 2009 01:46:02 -0000 >@@ -14,7 +14,6 @@ > import java.util.*; > > import org.eclipse.rwt.internal.theme.*; >-import org.eclipse.swt.graphics.Rectangle; > import org.w3c.css.sac.Selector; > import org.w3c.css.sac.SelectorList; > >@@ -33,8 +32,6 @@ > > public StyleSheet( final StyleRule[] styleRules ) { > this.styleRules = styleRules; >- // TODO: [if] Find better solution for merging border and border-radius >- mergeBorderRadius(); > createSelectorWrappers(); > } > >@@ -89,23 +86,6 @@ > return buffer.toString(); > } > >- private void mergeBorderRadius() { >- for( int i_rule = 0; i_rule < styleRules.length; i_rule++ ) { >- StyleRule styleRule = styleRules[ i_rule ]; >- IStylePropertyMap properties = styleRule.getProperties(); >- QxBorder border = ( QxBorder )properties.getValue( "border" ); >- QxBoxDimensions radius >- = ( QxBoxDimensions )properties.getValue( "border-radius" ); >- if( border != null && radius != null ) { >- Rectangle borderRadius = new Rectangle( radius.top, >- radius.right, >- radius.bottom, >- radius.left ); >- border.radius = borderRadius; >- } >- } >- } >- > private void createSelectorWrappers() { > ArrayList selectorWrappersList = new ArrayList(); > for( int i_rule = 0; i_rule < styleRules.length; i_rule++ ) {
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 282903
: 141149