[squeak-dev] The Trunk: Morphic-mt.1807.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Dec 2 15:07:43 UTC 2021


Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1807.mcz

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

Name: Morphic-mt.1807
Author: mt
Time: 2 December 2021, 4:07:38.353715 pm
UUID: c0df95ee-9347-1d47-b845-35b6b99a4f51
Ancestors: Morphic-mt.1806

Complements Collections-mt.966

=============== Diff against Morphic-mt.1806 ===============

Item was changed:
  ----- Method: DialogWindow>>setMessageParameters (in category 'initialization') -----
  setMessageParameters
  
+ 	| fontToUse colorToUse |
- 	| fontToUse colorToUse fontAttr offset |
  	messageMorph ifNil: [^ self].
  
  	fontToUse := self userInterfaceTheme font ifNil: [TextStyle defaultFont].
  	colorToUse := self userInterfaceTheme textColor ifNil: [Color black].
  	
  	messageMorph
  		hResizing: #shrinkWrap;
  		vResizing: #shrinkWrap;
  		textColor: colorToUse.
+ 
+ 	messageMorph contents
+ 		addAttribute: (TextFontReference toFont: fontToUse)
+ 		unless: [:attrs | attrs anySatisfy: [:each |
+ 			"Do not overwrite existing font attributes."
+ 			each class == TextFontChange or: [each class == TextFontReference]]].
+ 	messageMorph contents
+ 		addAttribute: (TextColor color: colorToUse)
+ 		unless: [:attrs | attrs anySatisfy: [:each |
+ 			"Do not overwrite existing color attributes"
+ 			each class == TextColor or: [each mayActOnClick "usually colored, too"]]].!
- 	
- 	"Only set text attributes for ranges that have none."
- 	self flag: #todo. "mt: Add interface to Text?"
- 	self flag: #todo. "mt: Do the same for TextColor. We must not know that #textColor: above does all the magic already."
- 	fontAttr := TextFontReference toFont: fontToUse.
- 	offset := nil.
- 	messageMorph contents runs withIndexDo: [:attrs :index |
- 		(attrs anySatisfy: [:each | each isKindOf: TextFontChange])
- 			ifFalse: [offset ifNil: [offset := index]]
- 			ifTrue: [offset ifNotNil: [
- 				messageMorph contents
- 					addAttribute: fontAttr
- 					from: offset to: index - 1.
- 				offset := nil]]].
- 	offset ifNotNil: [
- 		messageMorph contents
- 			addAttribute: fontAttr
- 			from: offset to: messageMorph contents size].
- !



More information about the Squeak-dev mailing list