|
Lines 103-128
Link Here
|
| 103 |
// Overwritten: |
103 |
// Overwritten: |
| 104 |
renderBorder : function( changes ) { |
104 |
renderBorder : function( changes ) { |
| 105 |
var value = this.__borderObject; |
105 |
var value = this.__borderObject; |
| 106 |
if( value ) { |
106 |
if( value && value.getStyle() === "rounded" ) { |
| 107 |
if( value.getStyle() === "rounded" ) { |
107 |
this._styleGfxBorder( value.getWidths(), value.getColor(), value.getRadii() ); |
| 108 |
this._styleGfxBorder( value.getWidths(), value.getColor(), value.getRadii() ); |
|
|
| 109 |
} else { |
| 110 |
value.render( this ); |
| 111 |
} |
| 112 |
} else { |
108 |
} else { |
| 113 |
this._style.border = ""; |
109 |
if( this._gfxBorderEnabled ) { |
| 114 |
if( this._innerStyle ) { |
110 |
this._styleGfxBorder( null, null, null ); |
| 115 |
this._innerStyle.border = ""; |
|
|
| 116 |
} |
111 |
} |
|
|
112 |
this.base( arguments, changes ); |
| 117 |
} |
113 |
} |
| 118 |
// RAP: Fix for Bug 301709 |
|
|
| 119 |
this._usesComplexBorder = this._computeUsesComplexBorder(); |
| 120 |
}, |
114 |
}, |
| 121 |
|
115 |
|
| 122 |
_styleGfxBorder : function( width, color, radii ) { |
116 |
_styleGfxBorder : function( width, color, radii ) { |
| 123 |
// NOTE: widgets with no dimensions of their own wont work together |
117 |
// NOTE: widgets with no dimensions of their own wont work together |
| 124 |
// with a gfxBorder (accepted bug) |
118 |
// with a gfxBorder (accepted bug) |
| 125 |
this.setGfxProperty( "borderWidths", width ); |
|
|
| 126 |
var max = 0; |
119 |
var max = 0; |
| 127 |
if( width ) { |
120 |
if( width ) { |
| 128 |
for( var i = 0; i < width.length; i++ ) { |
121 |
for( var i = 0; i < width.length; i++ ) { |
|
Lines 143-152
Link Here
|
| 143 |
} else { |
136 |
} else { |
| 144 |
renderRadii = radii; |
137 |
renderRadii = radii; |
| 145 |
} |
138 |
} |
|
|
139 |
this.setGfxProperty( "borderWidths", width ); |
| 146 |
this.setGfxProperty( "borderMaxWidth", max ); |
140 |
this.setGfxProperty( "borderMaxWidth", max ); |
| 147 |
this.setGfxProperty( "borderColor", color ); |
141 |
this.setGfxProperty( "borderColor", color ); |
| 148 |
this.setGfxProperty( "borderRadii", renderRadii ); |
142 |
this.setGfxProperty( "borderRadii", renderRadii ); |
| 149 |
this.setGfxProperty( "borderLayouted", null ); // use GfxBorder to chcek |
143 |
this.setGfxProperty( "borderLayouted", null ); // the last rendered gfx-border |
| 150 |
this._handleGfxBorder(); |
144 |
this._handleGfxBorder(); |
| 151 |
}, |
145 |
}, |
| 152 |
|
146 |
|
|
Lines 158-177
Link Here
|
| 158 |
}, |
152 |
}, |
| 159 |
|
153 |
|
| 160 |
getGfxProperty : function( key ) { |
154 |
getGfxProperty : function( key ) { |
| 161 |
var value = this._gfxProperties !== null |
155 |
var value = this._gfxProperties !== null ? this._gfxProperties[ key ] : null; |
| 162 |
? this._gfxProperties[ key ] |
|
|
| 163 |
: null; |
| 164 |
return typeof value != "undefined" ? value : null; |
156 |
return typeof value != "undefined" ? value : null; |
| 165 |
}, |
157 |
}, |
| 166 |
|
|
|
| 167 |
//overwritten: |
| 168 |
_computeUsesComplexBorder : function() { |
| 169 |
var result = this._gfxBorderEnabled && this.getGfxProperty( "borderMaxWidth" ) > 0 ; |
| 170 |
if( !result ) { |
| 171 |
result = this.base( arguments ); |
| 172 |
} |
| 173 |
return result; |
| 174 |
}, |
| 175 |
|
158 |
|
| 176 |
/////////////////// |
159 |
/////////////////// |
| 177 |
// internals - main |
160 |
// internals - main |
|
Lines 183-217
Link Here
|
| 183 |
var toggle = ( this._gfxBorderEnabled != useBorder ); |
166 |
var toggle = ( this._gfxBorderEnabled != useBorder ); |
| 184 |
if( toggle ) { |
167 |
if( toggle ) { |
| 185 |
if( useBorder ) { |
168 |
if( useBorder ) { |
| 186 |
this.addEventListener( "changeBorder", |
|
|
| 187 |
this._gfxOnBorderChanged, |
| 188 |
this ); |
| 189 |
this._gfxBorderEnabled = true; |
169 |
this._gfxBorderEnabled = true; |
| 190 |
} else { |
170 |
} else { |
| 191 |
this.removeStyleProperty( "padding" ); |
171 |
this.removeStyleProperty( "padding" ); |
| 192 |
this.removeEventListener( "changeBorder", |
|
|
| 193 |
this._gfxOnBorderChanged, |
| 194 |
this ); |
| 195 |
this._gfxBorderEnabled = false; |
172 |
this._gfxBorderEnabled = false; |
| 196 |
} |
173 |
} |
| 197 |
this._handleGfxBackground(); |
174 |
this._handleGfxBackground(); |
| 198 |
this._handleGfxStatus(); |
175 |
this._handleGfxStatus(); // TODO [tb] : implicitly in handleGfxBackground? |
|
|
176 |
if( !useBorder ) { |
| 177 |
this._handleTargetNode(); |
| 178 |
} |
| 199 |
} |
179 |
} |
| 200 |
// if gfxBorder is not used, canvas can still ready for background |
180 |
// if gfxBorder is not used, canvas can still ready for background |
| 201 |
if( ( toggle || useBorder ) && this._isCanvasReady() ) { |
181 |
if( ( toggle || useBorder ) && this._isCanvasReady() ) { |
| 202 |
this._renderGfxBorder(); |
182 |
this._renderGfxBorder(); |
| 203 |
if( !useBorder || !this._willBeLayouted() ) { |
183 |
if( !useBorder || !this._willBeLayouted() ) { |
| 204 |
// TODO [tb] : refactor conditions, "!useBorder" is only for padding |
184 |
// TODO [tb] : refactor conditions, "!useBorder" is only for padding |
| 205 |
this._layoutGfxBorder(); |
185 |
this._layoutBackgroundShape(); |
| 206 |
if( this._gfxShadowEnabled ) { |
186 |
if( this._gfxShadowEnabled ) { |
| 207 |
this._layoutGfxShadow(); |
187 |
this._layoutShadowShape(); |
| 208 |
} |
188 |
} |
| 209 |
} |
189 |
} |
| 210 |
this._handleFlushListener(); |
190 |
} |
| 211 |
} else if( toggle && !useBorder && this._innerStyle ) { |
|
|
| 212 |
this._handleFlushListener(); |
| 213 |
this._setSimulatedPadding(); |
| 214 |
} |
| 215 |
}, |
191 |
}, |
| 216 |
|
192 |
|
| 217 |
_handleGfxBackground : function() { |
193 |
_handleGfxBackground : function() { |
|
Lines 249-258
Link Here
|
| 249 |
} |
225 |
} |
| 250 |
if( ( toggle || useBackground ) && this._isCanvasReady() ) { |
226 |
if( ( toggle || useBackground ) && this._isCanvasReady() ) { |
| 251 |
this._renderGfxBackground(); |
227 |
this._renderGfxBackground(); |
| 252 |
} else if( !useBackground |
228 |
} else if( !useBackground && this._gfxData && this._gfxData.backgroundInsert ) { |
| 253 |
&& this._gfxData |
|
|
| 254 |
&& this._gfxData.backgroundInsert ) |
| 255 |
{ |
| 256 |
this._prepareBackgroundShape(); |
229 |
this._prepareBackgroundShape(); |
| 257 |
} |
230 |
} |
| 258 |
}, |
231 |
}, |
|
Lines 261-267
Link Here
|
| 261 |
var hasShadow = this.getGfxProperty( "shadow" ) != null; |
234 |
var hasShadow = this.getGfxProperty( "shadow" ) != null; |
| 262 |
this._gfxShadowEnabled = hasShadow; |
235 |
this._gfxShadowEnabled = hasShadow; |
| 263 |
this._handleGfxStatus(); |
236 |
this._handleGfxStatus(); |
| 264 |
this._handleFlushListener(); |
|
|
| 265 |
if( this._isCanvasReady() ) { |
237 |
if( this._isCanvasReady() ) { |
| 266 |
this._renderGfxShadow(); |
238 |
this._renderGfxShadow(); |
| 267 |
} else if( !this._gfxShadowEnabled && this._gfxData && this._gfxData.shadowInsert ) { |
239 |
} else if( !this._gfxShadowEnabled && this._gfxData && this._gfxData.shadowInsert ) { |
|
Lines 270-290
Link Here
|
| 270 |
}, |
242 |
}, |
| 271 |
|
243 |
|
| 272 |
_handleGfxStatus : function() { |
244 |
_handleGfxStatus : function() { |
| 273 |
var useGfx = this._gfxBorderEnabled |
245 |
var useGfx = this._gfxBorderEnabled || this._gfxBackgroundEnabled || this._gfxShadowEnabled; |
| 274 |
|| this._gfxBackgroundEnabled |
246 |
if( useGfx != this._gfxEnabled ) { |
| 275 |
|| this._gfxShadowEnabled; |
|
|
| 276 |
if( useGfx != this._gfxEnabled ) { |
| 277 |
if( useGfx ) { |
247 |
if( useGfx ) { |
| 278 |
this.addEventListener( "changeElement", |
248 |
this.addEventListener( "changeElement", this._gfxOnElementChanged, this ); |
| 279 |
this._gfxOnElementChanged, |
|
|
| 280 |
this ); |
| 281 |
this._gfxEnabled = true; |
249 |
this._gfxEnabled = true; |
| 282 |
} else { |
250 |
} else { |
| 283 |
this.removeEventListener( "changeElement", |
251 |
this.removeEventListener( "changeElement", this._gfxOnElementChanged, this ); |
| 284 |
this._gfxOnElementChanged, |
|
|
| 285 |
this ); |
| 286 |
this._gfxEnabled = false; |
252 |
this._gfxEnabled = false; |
| 287 |
} |
253 |
} |
|
|
254 |
this._handleFlushListener(); |
| 288 |
} |
255 |
} |
| 289 |
}, |
256 |
}, |
| 290 |
|
257 |
|
|
Lines 328-333
Link Here
|
| 328 |
} |
295 |
} |
| 329 |
} |
296 |
} |
| 330 |
this.prepareEnhancedBorder(); |
297 |
this.prepareEnhancedBorder(); |
|
|
298 |
// TODO [tb] : redundand in some cases: |
| 299 |
this.addToQueue( "width" ); |
| 300 |
this.addToQueue( "height" ); |
| 331 |
if( outline ) { |
301 |
if( outline ) { |
| 332 |
this.setStyleProperty( "outline", outline ); |
302 |
this.setStyleProperty( "outline", outline ); |
| 333 |
} |
303 |
} |
|
Lines 341-348
Link Here
|
| 341 |
|
311 |
|
| 342 |
_appendCanvas : function() { |
312 |
_appendCanvas : function() { |
| 343 |
var parentNode = this.getElement(); |
313 |
var parentNode = this.getElement(); |
| 344 |
var gfxNode |
314 |
var gfxNode = org.eclipse.rwt.GraphicsUtil.getCanvasNode( this._gfxCanvas ); |
| 345 |
= org.eclipse.rwt.GraphicsUtil.getCanvasNode( this._gfxCanvas ); |
|
|
| 346 |
if( gfxNode != null ) { |
315 |
if( gfxNode != null ) { |
| 347 |
parentNode.insertBefore( gfxNode, parentNode.firstChild ); |
316 |
parentNode.insertBefore( gfxNode, parentNode.firstChild ); |
| 348 |
} |
317 |
} |
|
Lines 354-361
Link Here
|
| 354 |
}, |
323 |
}, |
| 355 |
|
324 |
|
| 356 |
_removeCanvas : function() { |
325 |
_removeCanvas : function() { |
| 357 |
var gfxNode |
326 |
var gfxNode = org.eclipse.rwt.GraphicsUtil.getCanvasNode( this._gfxCanvas ); |
| 358 |
= org.eclipse.rwt.GraphicsUtil.getCanvasNode( this._gfxCanvas ); |
|
|
| 359 |
if( gfxNode != null ) { |
327 |
if( gfxNode != null ) { |
| 360 |
gfxNode.parentNode.removeChild( gfxNode ); |
328 |
gfxNode.parentNode.removeChild( gfxNode ); |
| 361 |
this._gfxCanvasAppended = false; |
329 |
this._gfxCanvasAppended = false; |
|
Lines 370-394
Link Here
|
| 370 |
var util = org.eclipse.rwt.GraphicsUtil; |
338 |
var util = org.eclipse.rwt.GraphicsUtil; |
| 371 |
var backgroundShape = this._gfxData.backgroundShape; |
339 |
var backgroundShape = this._gfxData.backgroundShape; |
| 372 |
if( this._gfxBackgroundEnabled ) { |
340 |
if( this._gfxBackgroundEnabled ) { |
| 373 |
var usePath = this._gfxBorderEnabled; |
|
|
| 374 |
if( backgroundShape === undefined ) { |
341 |
if( backgroundShape === undefined ) { |
| 375 |
this._gfxData.backgroundShape = this._createBackgroundShape( usePath ); |
342 |
this._gfxData.backgroundShape = util.createShape( "roundrect" ); |
| 376 |
} else { |
|
|
| 377 |
if( usePath && backgroundShape === this._gfxData.rectShape ) { |
| 378 |
if( this._gfxData.backgroundInsert ) { |
| 379 |
util.removeFromCanvas( this._gfxCanvas, backgroundShape ); |
| 380 |
this._gfxData.backgroundInsert = false; |
| 381 |
} |
| 382 |
delete this._gfxData.rectShape; |
| 383 |
this._gfxData.backgroundShape = this._createBackgroundShape( usePath ); |
| 384 |
} else if( !usePath && backgroundShape === this._gfxData.pathElement ) { |
| 385 |
if( this._gfxData.backgroundInsert ) { |
| 386 |
util.removeFromCanvas( this._gfxCanvas, backgroundShape ); |
| 387 |
this._gfxData.backgroundInsert = false; |
| 388 |
} |
| 389 |
delete this._gfxData.pathElement; |
| 390 |
this._gfxData.backgroundShape = this._createBackgroundShape( usePath ); |
| 391 |
} |
| 392 |
} |
343 |
} |
| 393 |
if( !this._gfxData.backgroundInsert ) { |
344 |
if( !this._gfxData.backgroundInsert ) { |
| 394 |
var shape = this._gfxData.backgroundShape; |
345 |
var shape = this._gfxData.backgroundShape; |
|
Lines 401-421
Link Here
|
| 401 |
} |
352 |
} |
| 402 |
}, |
353 |
}, |
| 403 |
|
354 |
|
| 404 |
_createBackgroundShape : function( usePath ) { |
|
|
| 405 |
var shape = null; |
| 406 |
var util = org.eclipse.rwt.GraphicsUtil; |
| 407 |
if( usePath ) { |
| 408 |
shape = util.createShape( "roundrect" ); |
| 409 |
this._gfxData.pathElement = shape; |
| 410 |
} else { |
| 411 |
var shape = util.createShape( "rect" ); |
| 412 |
util.setRectBounds( shape, "0%", "0%", "100%", "100%" ); |
| 413 |
this._gfxData.rectShape = shape; |
| 414 |
} |
| 415 |
return shape; |
| 416 |
}, |
| 417 |
|
| 418 |
|
| 419 |
///////////////////////// |
355 |
///////////////////////// |
| 420 |
// internals - background |
356 |
// internals - background |
| 421 |
|
357 |
|
|
Lines 444-450
Link Here
|
| 444 |
_renderGfxBorder : function() { |
380 |
_renderGfxBorder : function() { |
| 445 |
this._style.borderWidth = 0; |
381 |
this._style.borderWidth = 0; |
| 446 |
var inner = this._innerStyle; |
382 |
var inner = this._innerStyle; |
| 447 |
inner.borderWidth = 0; |
383 |
inner.borderWidth = 0; // TODO [tb] : useless? |
| 448 |
this._prepareBackgroundShape(); |
384 |
this._prepareBackgroundShape(); |
| 449 |
var shape = this._gfxData.backgroundShape; |
385 |
var shape = this._gfxData.backgroundShape; |
| 450 |
var width = this.getGfxProperty( "borderMaxWidth" ); |
386 |
var width = this.getGfxProperty( "borderMaxWidth" ); |
|
Lines 452-471
Link Here
|
| 452 |
org.eclipse.rwt.GraphicsUtil.setStroke( shape, color, width ); |
388 |
org.eclipse.rwt.GraphicsUtil.setStroke( shape, color, width ); |
| 453 |
}, |
389 |
}, |
| 454 |
|
390 |
|
| 455 |
_layoutGfxBorder : function() { |
391 |
_layoutBackgroundShape : function() { |
| 456 |
var rectDimension = [ this.getBoxWidth(), this.getBoxHeight() ]; |
392 |
var rectDimension = [ this.getBoxWidth(), this.getBoxHeight() ]; |
| 457 |
var oldDimension = this.getGfxProperty( "borderLayouted" ); |
393 |
var oldDimension = this.getGfxProperty( "borderLayouted" ); |
| 458 |
var changedX |
394 |
var changedX = !oldDimension || ( rectDimension[ 0 ] !== oldDimension[ 0 ] ); |
| 459 |
= !oldDimension || ( rectDimension[ 0 ] !== oldDimension[ 0 ] ); |
395 |
var changedY = !oldDimension || ( rectDimension[ 1 ] !== oldDimension[ 1 ] ); |
| 460 |
var changedY |
|
|
| 461 |
= !oldDimension || ( rectDimension[ 1 ] !== oldDimension[ 1 ] ); |
| 462 |
if( changedX || changedY ) { |
396 |
if( changedX || changedY ) { |
| 463 |
this.setGfxProperty( "borderLayouted", rectDimension ); |
397 |
this.setGfxProperty( "borderLayouted", rectDimension ); |
| 464 |
this._setSimulatedPadding(); |
398 |
this._handleTargetNode(); |
| 465 |
var rectDimension = [ this.getBoxWidth(), this.getBoxHeight() ]; |
399 |
var rectDimension = [ this.getBoxWidth(), this.getBoxHeight() ]; // TODO [tb] : useless? |
| 466 |
var radii = this.getGfxProperty( "borderRadii" ); |
400 |
// TODO [tb] : refactor from here |
| 467 |
var borderWidth = this.getGfxProperty( "borderWidths" ); |
401 |
var rectWidth; |
| 468 |
if( borderWidth != null && radii != null ) { |
402 |
var rectHeight; |
|
|
403 |
var left; |
| 404 |
var top; |
| 405 |
var radii; |
| 406 |
if( this._gfxBorderEnabled ) { |
| 407 |
radii = this.getGfxProperty( "borderRadii" ); |
| 408 |
var borderWidth = this.getGfxProperty( "borderWidths" ); |
| 469 |
var maxWidth = this.getGfxProperty( "borderMaxWidth" ); |
409 |
var maxWidth = this.getGfxProperty( "borderMaxWidth" ); |
| 470 |
var borderTop = 0; |
410 |
var borderTop = 0; |
| 471 |
var borderRight = 0; |
411 |
var borderRight = 0; |
|
Lines 481-527
Link Here
|
| 481 |
borderBottom = ( borderWidth[ 2 ] == 0 ? -maxWidth - 1 : maxWidth ); |
421 |
borderBottom = ( borderWidth[ 2 ] == 0 ? -maxWidth - 1 : maxWidth ); |
| 482 |
borderLeft = ( borderWidth[ 3 ] == 0 ? -maxWidth - 1: maxWidth ); |
422 |
borderLeft = ( borderWidth[ 3 ] == 0 ? -maxWidth - 1: maxWidth ); |
| 483 |
} |
423 |
} |
| 484 |
var rectWidth = |
424 |
rectWidth = rectDimension[ 0 ] - ( borderLeft * 0.5 + borderRight * 0.5 ); |
| 485 |
rectDimension[ 0 ] - ( borderLeft * 0.5 + borderRight * 0.5 ); |
425 |
rectHeight = rectDimension[ 1 ] - ( borderTop * 0.5 + borderBottom * 0.5 ); |
| 486 |
var rectHeight = |
426 |
left = borderLeft * 0.5; |
| 487 |
rectDimension[ 1 ] - ( borderTop * 0.5 + borderBottom * 0.5 ); |
427 |
top = borderTop * 0.5; |
| 488 |
var left = borderLeft * 0.5; |
428 |
} else { |
| 489 |
var top = borderTop * 0.5; |
429 |
// TODO [tb] : write tests for this case |
| 490 |
//a few safeguards: |
430 |
left = 0 |
| 491 |
rectWidth = Math.max( 0, rectWidth ); |
431 |
top = 0; |
| 492 |
rectHeight = Math.max( 0, rectHeight ); |
432 |
rectWidth = rectDimension[ 0 ] - this._cachedBorderLeft - this._cachedBorderRight; |
| 493 |
var shape = this._gfxData.pathElement; |
433 |
rectHeight = rectDimension[ 1 ] - this._cachedBorderTop - this._cachedBorderBottom; |
| 494 |
org.eclipse.rwt.GraphicsUtil.setRoundRectLayout( shape, |
434 |
radii = [ 0, 0, 0, 0 ]; |
| 495 |
left, |
435 |
} |
| 496 |
top, |
436 |
//a few safeguards: |
| 497 |
rectWidth, |
437 |
rectWidth = Math.max( 0, rectWidth ); |
| 498 |
rectHeight, |
438 |
rectHeight = Math.max( 0, rectHeight ); |
| 499 |
radii ); |
439 |
var shape = this._gfxData.backgroundShape; |
| 500 |
} |
440 |
var util = org.eclipse.rwt.GraphicsUtil; |
|
|
441 |
util.setRoundRectLayout( shape, left, top, rectWidth, rectHeight, radii ); |
| 501 |
} |
442 |
} |
| 502 |
}, |
443 |
}, |
| 503 |
|
444 |
|
| 504 |
_setSimulatedPadding : function() { |
445 |
_handleTargetNode : function() { |
| 505 |
var isMshtml = qx.core.Variant.isSet( "qx.client", "mshtml" ); |
446 |
if( this._innerStyle ) { |
| 506 |
var width = this.getGfxProperty( "borderWidths" ); |
447 |
if( this._gfxBorderEnabled ) { |
| 507 |
if( width ) { |
448 |
var rect = this.getGfxProperty( "borderLayouted" ); |
| 508 |
var rect = this.getGfxProperty( "borderLayouted" ); |
449 |
var width = this.getGfxProperty( "borderWidths" ); |
| 509 |
var style = this._innerStyle; |
450 |
var style = this._innerStyle; |
| 510 |
style.top = width[ 0 ] + "px"; |
451 |
style.top = width[ 0 ] + "px"; |
| 511 |
style.left = width[ 3 ] + "px"; |
452 |
style.left = width[ 3 ] + "px"; |
| 512 |
style.width = Math.max( 0, rect[ 0 ] - width[ 3 ] - width[ 1 ] ) + "px"; |
453 |
style.width = Math.max( 0, rect[ 0 ] - width[ 3 ] - width[ 1 ] ) + "px"; |
| 513 |
style.height = Math.max( 0, rect[ 1 ] - width[ 0 ] - width[ 2 ] ) + "px"; |
454 |
style.height = Math.max( 0, rect[ 1 ] - width[ 0 ] - width[ 2 ] ) + "px"; |
| 514 |
} else { |
455 |
} else if( !this._gfxEnabled ) { |
| 515 |
this._innerStyle.left = "0px"; |
456 |
this._innerStyle.left = "0px"; |
| 516 |
this._innerStyle.top = "0px"; |
457 |
this._innerStyle.top = "0px"; |
| 517 |
if( isMshtml ) { |
458 |
if( qx.core.Variant.isSet( "qx.client", "mshtml" ) ) { |
| 518 |
this._innerStyle.width = ""; |
459 |
this._innerStyle.width = ""; |
| 519 |
this._innerStyle.height = ""; |
460 |
this._innerStyle.height = ""; |
| 520 |
this.addToQueue( "width" ); |
461 |
this.addToQueue( "width" ); |
| 521 |
this.addToQueue( "height" ); |
462 |
this.addToQueue( "height" ); |
| 522 |
} else { |
463 |
} else { |
| 523 |
this._innerStyle.width = "100%"; |
464 |
this._innerStyle.width = "100%"; |
| 524 |
this._innerStyle.height = "100%"; |
465 |
this._innerStyle.height = "100%"; |
|
|
466 |
} |
| 525 |
} |
467 |
} |
| 526 |
} |
468 |
} |
| 527 |
}, |
469 |
}, |
|
Lines 529-535
Link Here
|
| 529 |
_handleFlushListener : function( value ) { |
471 |
_handleFlushListener : function( value ) { |
| 530 |
var enhanced = this._innerStyle || this._gfxEnabled; |
472 |
var enhanced = this._innerStyle || this._gfxEnabled; |
| 531 |
this._layoutTargetNode = enhanced && !this._gfxBorderEnabled; |
473 |
this._layoutTargetNode = enhanced && !this._gfxBorderEnabled; |
| 532 |
if( this._gfxBorderEnabled || this._gfxShadowEnabled ) { |
474 |
if( this._gfxEnabled) { |
| 533 |
this.addEventListener( "flush", this._gfxOnFlush, this ); |
475 |
this.addEventListener( "flush", this._gfxOnFlush, this ); |
| 534 |
} else { |
476 |
} else { |
| 535 |
this.removeEventListener( "flush", this._gfxOnFlush, this ); |
477 |
this.removeEventListener( "flush", this._gfxOnFlush, this ); |
|
Lines 581-591
Link Here
|
| 581 |
util.setBlur( shape, shadow[ 3 ] ); |
523 |
util.setBlur( shape, shadow[ 3 ] ); |
| 582 |
util.setFillColor( shape, shadow[ 5 ] ); |
524 |
util.setFillColor( shape, shadow[ 5 ] ); |
| 583 |
util.setOpacity( shape, shadow[ 6 ] ); |
525 |
util.setOpacity( shape, shadow[ 6 ] ); |
| 584 |
this._layoutGfxShadow(); |
526 |
this._layoutShadowShape(); |
| 585 |
} |
527 |
} |
| 586 |
}, |
528 |
}, |
| 587 |
|
529 |
|
| 588 |
_layoutGfxShadow : function() { |
530 |
_layoutShadowShape : function() { |
| 589 |
var util = org.eclipse.rwt.GraphicsUtil; |
531 |
var util = org.eclipse.rwt.GraphicsUtil; |
| 590 |
var rect = [ this.getBoxWidth(), this.getBoxHeight() ]; |
532 |
var rect = [ this.getBoxWidth(), this.getBoxHeight() ]; |
| 591 |
var shape = this._gfxData.shadowShape; |
533 |
var shape = this._gfxData.shadowShape; |
|
Lines 625-632
Link Here
|
| 625 |
}, |
567 |
}, |
| 626 |
|
568 |
|
| 627 |
_willBeLayouted : function() { |
569 |
_willBeLayouted : function() { |
| 628 |
return typeof this._jobQueue != "undefined" |
570 |
return this._jobQueue != undefined || !qx.lang.Object.isEmpty( this._layoutChanges ); |
| 629 |
|| !qx.lang.Object.isEmpty( this._layoutChanges ); |
|
|
| 630 |
}, |
571 |
}, |
| 631 |
|
572 |
|
| 632 |
// called after the element of the widget has been set |
573 |
// called after the element of the widget has been set |
|
Lines 645-658
Link Here
|
| 645 |
} |
586 |
} |
| 646 |
}, |
587 |
}, |
| 647 |
|
588 |
|
| 648 |
//called if the GfxBorder object has been replaced |
|
|
| 649 |
_gfxOnBorderChanged : function( event ) { |
| 650 |
var border = event.getValue(); |
| 651 |
if ( !( border && border.getStyle() === "rounded" ) ) { |
| 652 |
this._styleGfxBorder( null, null, null ); |
| 653 |
} |
| 654 |
}, |
| 655 |
|
| 656 |
_onCanvasAppear : function() { |
589 |
_onCanvasAppear : function() { |
| 657 |
if( this._gfxCanvasAppended ) { |
590 |
if( this._gfxCanvasAppended ) { |
| 658 |
org.eclipse.rwt.GraphicsUtil.handleAppear( this._gfxCanvas ); |
591 |
org.eclipse.rwt.GraphicsUtil.handleAppear( this._gfxCanvas ); |
|
Lines 665-675
Link Here
|
| 665 |
if ( changes.paddingRight || changes.paddingBottom ) { |
598 |
if ( changes.paddingRight || changes.paddingBottom ) { |
| 666 |
this.setGfxProperty( "borderLayouted", null ); |
599 |
this.setGfxProperty( "borderLayouted", null ); |
| 667 |
} |
600 |
} |
| 668 |
if( this._gfxBorderEnabled ) { |
601 |
if( this._gfxBackgroundEnabled ) { // gfxBorder implicitly enables gfx-background |
| 669 |
this._layoutGfxBorder(); |
602 |
this._layoutBackgroundShape(); |
| 670 |
} |
603 |
} |
| 671 |
if( this._gfxShadowEnabled ) { |
604 |
if( this._gfxShadowEnabled ) { |
| 672 |
this._layoutGfxShadow(); |
605 |
this._layoutShadowShape(); |
| 673 |
} |
606 |
} |
| 674 |
} |
607 |
} |
| 675 |
|
608 |
|