[squeak-dev] The Trunk: Morphic-ul.461.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Aug 22 23:01:20 UTC 2010


Levente Uzonyi uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ul.461.mcz

==================== Summary ====================

Name: Morphic-ul.461
Author: ul
Time: 23 August 2010, 12:54:17.163 am
UUID: 4e51384f-c016-5545-9cb7-aefa9f7bec9a
Ancestors: Morphic-eem.460

- fix for http://bugs.squeak.org/view.php?id=7556
- make sure that we restore the original font of the StringMorph when the font is changed by 'Apply', but the font chooser is closed by 'Cancel'

=============== Diff against Morphic-eem.460 ===============

Item was changed:
  ----- Method: StringMorph>>changeFont (in category 'menu') -----
  changeFont
+ 	
+ 	| chooser originalFont |
+ 	originalFont := self fontToUse.
+ 	self openModal: (
+ 		Cursor wait showWhile: [
+ 			| window |
+ 			window := UIManager default 
+ 				chooseFont: 'Choose a Font' 
+ 				for: self 
+ 				setSelector: #font: 
+ 				getSelector: originalFont.
+ 			"We have to save the model here, because it will be gone when the window is closed."
+ 			chooser := window model. 
+ 			window ]).
+ 	originalFont = self fontToUse ifFalse: [
+ 		"Ensure that we restore the original font in case it was changed, but Cancel was clicked."
+ 		self font: (chooser result ifNil: [ originalFont ]) ]!
- 	| newFont chooser|
- 	chooser := self openModal: (
- 		Cursor wait showWhile: [UIManager default 
- 			chooseFont: 'Choose a Font' 
- 			for: self 
- 			setSelector: #font: 
- 			getSelector: self fontToUse]).
- 	newFont := chooser result.
- 	newFont ifNotNil:[self font: newFont].!




More information about the Squeak-dev mailing list