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

commits at source.squeak.org commits at source.squeak.org
Mon Sep 30 13:57:22 UTC 2019


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

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

Name: Morphic-mt.1551
Author: mt
Time: 30 September 2019, 3:57:16.04771 pm
UUID: a496bd6a-f249-1d41-8989-e6383d6a0826
Ancestors: Morphic-mt.1550

Like Morphic-mt.1550, complement the change in Morphic-mt.1520. 

Before 1520, using #contents: did set wrapFlag to "false", which effectively initializes every TextMorph with that value because "TextMorph new contents: 'foobar'" is kind of common. After 1520, that's not the case anymore. So, this commit really sets wrapFlag to "false" and finally adds autoFit to #initialize as well.

As long as the client configures text morphs with their #contents, wrapping makes no sense. Only if that configuration considers both #contents and #width, wrapping matters. Since that is the case for tool building, I will change the default treatment of PluggableTextSpec >> #softLineWrap directly after this commit.

=============== Diff against Morphic-mt.1550 ===============

Item was changed:
  ----- Method: MenuMorph>>displayFiltered: (in category 'keyboard control') -----
  displayFiltered: evt
  	| matchStr allItems matches feedbackMorph |
  	matchStr := self valueOfProperty: #matchString.
  	allItems := self submorphs select: [:m | m isKindOf: MenuItemMorph].
  	matches :=  allItems select: [:m | | isMatch | 
  		isMatch := 
  			matchStr isEmpty or: [
  				m contents includesSubstring: matchStr caseSensitive: false].
  		m isEnabled: isMatch.
  		isMatch].
  	feedbackMorph := self valueOfProperty: #feedbackMorph.
  	feedbackMorph ifNil: [
+ 		feedbackMorph := TextMorph new
+ 			color: Color darkGray;
+ 			yourself.
- 		feedbackMorph := 
- 			TextMorph new 
- 				autoFit: true;
- 				wrapFlag: false;
- 				color: Color darkGray.
  		self
  			addLine;
  			addMorphBack: feedbackMorph lock.
  		self setProperty: #feedbackMorph toValue: feedbackMorph.
  		self fullBounds.  "Lay out for submorph adjacency"].
  	feedbackMorph contents: '<', matchStr, '>'.
  	matchStr isEmpty ifTrue: [
  		feedbackMorph delete.
  		self submorphs last delete.
  		self removeProperty: #feedbackMorph].
  	" This method is invoked with evt = nil from MenuMorph >> removeMatchString. 
  	The current implementation can't select an item without an event. "
  	(evt notNil and: [ matches size >= 1 ]) ifTrue: [
  		self selectItem: matches first event: evt]!

Item was changed:
  ----- Method: TextMorph>>initialize (in category 'initialization') -----
  initialize
  
  	super initialize.
  
  	textStyle := TextStyle default copy.
+ 	
+ 	wrapFlag := false.
+ 	autoFit := true.!
- 	wrapFlag := true.
- !

Item was changed:
  ----- Method: TextMorph>>isAutoFit (in category 'accessing') -----
  isAutoFit
+ 	"For migrating old instances only. See #initialize."
+ 	
- 
  	^ autoFit ifNil: [autoFit := true]!



More information about the Squeak-dev mailing list