'From etoys2.3 of 28 November 2007 [latest update: #1818] on 4 December 2007 at 3:12:16 am'! "Change Set: SugarNav22-yo Date: 4 December 2007 Author: Yoshiki Ohshima Make the project name field follow resizing and recoloring of bar. Also mitigates the fill color problem in it."! !SugarNavigatorBar methodsFor: 'morphic interaction' stamp: 'yo 12/4/2007 02:48'! naviHeight: anInteger anInteger > self height ifTrue: [^ self naviHeightWithFullUpdate: anInteger]. anInteger < 2 ifTrue: [^ self]. submorphs isEmpty ifTrue: [^ super extent: self width@anInteger]. self resizeButtonsAndTabTo: anInteger. ! ! !SugarNavigatorBar methodsFor: 'the actions' stamp: 'yo 12/4/2007 02:56'! makeProjectNameLabel | t | projectNameField _ SugarRoundedField new. t _ UpdatingStringMorph new. t setProperty: #okToTextEdit toValue: true. t putSelector: #projectNameChanged:. t getSelector: #projectName. projectNameField backgroundColor: self color. t target: self. t useStringFormat. t beSticky. t label: ActiveWorld project name font: (StrikeFont familyName: 'BitstreamVeraSans' size: 24). t color: Color black. t width: projectNameField width - 10. projectNameField label: t. projectNameField setBalloonText: self projectNameFieldBalloonHelp. projectNameField on: #mouseDown send: #mouseDown: to: t. projectNameField on: #mouseUp send: #mouseUp: to: t. self resizeProjectNameField. ^projectNameField. ! ! !SugarNavigatorBar methodsFor: 'the actions' stamp: 'yo 12/4/2007 03:10'! resizeProjectNameField "The height should be 45 according to the Sugar guilde line, but an odd number makes the circle distorted. To be general, it uses 60% of the height of bar." | h | h _ (self height * 0.6) roundTo: 2. projectNameField ifNotNil: [projectNameField extent: (Display width >= 1200 ifTrue: [240] ifFalse: [160])@h.]. ! ! !SugarRoundedField methodsFor: 'as yet unclassified' stamp: 'yo 12/4/2007 02:17'! backgroundColor: aColor backgroundColor _ aColor. mask _ self makeMask: self extent foregroundColor: color backgroundColor: backgroundColor. ! ! !SugarRoundedField methodsFor: 'as yet unclassified' stamp: 'yo 12/4/2007 03:08'! makeMask: extent foregroundColor: fgColor backgroundColor: bgColor | f c diameter | f _ Form extent: extent depth: 16. f fillColor: bgColor. c _ f getCanvas asBalloonCanvas. c aaLevel: 2. diameter _ extent x min: extent y. c drawOval: (0@0 extent: diameter@diameter) color: fgColor borderWidth: 0 borderColor: Color black. c drawOval: (((extent x - diameter)@0) extent: diameter@diameter) color: fgColor borderWidth: 0 borderColor: Color black. c fillRectangle: (((diameter // 2)@0) extent: ((extent x - diameter)@(extent y))) fillStyle: fgColor. c finish. ^ f. ! ! !SugarRoundedField methodsFor: 'as yet unclassified' stamp: 'yo 12/4/2007 02:55'! naviHeight: aNumber self extent: self width@(aNumber * 0.6). self recenterLabel.! ! "Postscript: " Flaps disableGlobalFlaps: false. Flaps enableEToyFlaps.!