'From Squeak3.1alpha of 5 February 2001 [latest update: #3522] on 6 February 2001 at 2:13:09 pm'! "Change Set: BetterRoundedWindows Date: 6 February 2001 Author: Dan Ingalls Improves the appearance of SystemWindows with rounded corners by increasing the corner width by the width of the panes (well, one of them ;-). A bit of a hack, but it does the job."! !FormCanvas methodsFor: 'drawing-general' stamp: 'di 2/6/2001 14:03'! roundCornersOf: aMorph during: aBlock aMorph wantsRoundedCorners ifFalse:[^aBlock value]. (self seesNothingOutside: (CornerRounder rectWithinCornersOf: aMorph bounds)) ifTrue: ["Don't bother with corner logic if the region is inside them" ^ aBlock value]. CornerRounder roundCornersOf: aMorph on: self displayBlock: aBlock borderWidth: aMorph borderWidthForRounding corners: aMorph roundedCorners! ! !Morph methodsFor: 'accessing' stamp: 'di 2/6/2001 14:02'! borderWidthForRounding ^ self borderWidth! ! !PluggableCanvas methodsFor: 'canvas methods' stamp: 'di 2/6/2001 14:02'! roundCornersOf: aMorph during: aBlock aMorph wantsRoundedCorners ifFalse:[^aBlock value]. (self seesNothingOutside: (CornerRounder rectWithinCornersOf: aMorph bounds)) ifTrue: ["Don't bother with corner logic if the region is inside them" ^ aBlock value]. CornerRounder roundCornersOf: aMorph on: self displayBlock: aBlock borderWidth: aMorph borderWidthForRounding corners: aMorph roundedCorners! ! !RemoteCanvas methodsFor: 'accessing' stamp: 'di 2/6/2001 14:03'! roundCornersOf: aMorph during: aBlock self flag: #roundedRudeness. aMorph wantsRoundedCorners ifFalse:[^aBlock value]. (self seesNothingOutside: (CornerRounder rectWithinCornersOf: aMorph bounds)) ifTrue: ["Don't bother with corner logic if the region is inside them" ^ aBlock value]. CornerRounder roundCornersOf: aMorph on: self displayBlock: aBlock borderWidth: aMorph borderWidthForRounding corners: aMorph roundedCorners! ! !SystemWindow methodsFor: 'geometry' stamp: 'di 2/6/2001 14:09'! borderWidthForRounding "Pane borders effectively increase the border size. This is a hack, but it usually looks good." (paneMorphs ~~ nil and: [paneMorphs size >= 1 and: [paneMorphs first borderWidth > 0]]) ifTrue: [^ self borderWidth + paneMorphs first borderWidth] ifFalse: [^ self borderWidth]! ! CornerRounder class removeSelector: #roundCornersOf:on:displayBlock:borderWidth:! CornerRounder removeSelector: #tweakCornersOf:on:borderWidth:!