'From Squeak3.1alpha of 5 February 2001 [latest update: #3582] on 12 February 2001 at 11:06:18 pm'! "Change Set: WindowBorderTweaks Date: 12 February 2001 Author: Dan Ingalls Two changes to make window borders more consistent, and rounded corners more uniform. "! !SystemWindow methodsFor: 'initialization' stamp: 'di 2/12/2001 22:52'! initialize | aFont | super initialize. allowReframeHandles := true. labelString ifNil: [labelString _ 'Untitled Window']. isCollapsed _ false. activeOnlyOnTop _ true. paneMorphs _ Array new. borderColor _ Color black. borderWidth _ 1. color _ Color black. self layoutPolicy: ProportionalLayout new. label _ StringMorph new contents: labelString; font: Preferences windowTitleFont emphasis: 1. "Add collapse box so #labelHeight will work" aFont _ Preferences standardButtonFont. collapseBox _ SimpleButtonMorph new borderWidth: 0; label: 'O' font: aFont; color: Color transparent; actionSelector: #collapseOrExpand; target: self; extent: 14@14. stripes _ Array with: (RectangleMorph newBounds: bounds) "see extent:" with: (RectangleMorph newBounds: bounds). self addLabelArea. labelArea addMorph: (stripes first borderWidth: 1). labelArea addMorph: (stripes second borderWidth: 2). self setLabelWidgetAllowance. self addCloseBox. self addMenuControl. labelArea addMorph: label. labelArea addMorph: collapseBox. self setFramesForLabelArea. Preferences noviceMode ifTrue: [closeBox ifNotNil: [closeBox setBalloonText: 'close window']. menuBox ifNotNil: [menuBox setBalloonText: 'window menu']. collapseBox ifNotNil: [collapseBox setBalloonText: 'collapse/expand window']]. self on: #mouseEnter send: #spawnReframeHandle: to: self. self on: #mouseLeave send: #spawnReframeHandle: to: self. label on: #mouseDown send: #relabelEvent: to: self. self extent: 300@200. mustNotClose _ false. updatablePanes _ Array new.! ! !SystemWindow methodsFor: 'geometry' stamp: 'di 2/12/2001 23:02'! borderWidthForRounding "Pane borders effectively increase the border size. This is a hack, but it usually looks good." self isCollapsed ifTrue: [^ 2]. (paneMorphs ~~ nil and: [paneMorphs size >= 1 and: [paneMorphs first borderWidth > 0]]) ifTrue: [^ self borderWidth + paneMorphs first borderWidth] ifFalse: [^ self borderWidth]! ! SystemWindow allSubInstancesDo: [:w | w borderColor: Color black]!