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

commits at source.squeak.org commits at source.squeak.org
Thu Apr 7 08:01:45 UTC 2022


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

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

Name: Morphic-mt.1963
Author: mt
Time: 7 April 2022, 10:01:39.871476 am
UUID: ae251895-3454-304e-92da-d19c9d10b963
Ancestors: Morphic-mt.1962

Renames #numCharactersPerLine to #averageLineLength. Step 2 of 2.

=============== Diff against Morphic-mt.1962 ===============

Item was changed:
  ----- Method: DialogWindow>>createMessage: (in category 'initialization') -----
  createMessage: aString 
  	
  	messageMorph := aString asText asMorph.
  	messageMorph
  		name: 'Message';
  		readOnly: true;
  		hResizing: #shrinkWrap; vResizing: #shrinkWrap;
+ 		averageLineLength: 45;
- 		numCharactersPerLine: 45;
  		setProperty: #indicateKeyboardFocus toValue: #never;
  		handlesKeyboardOnlyOnFocus: true. "If user presses enter while only hovering the text, we want to process the stroke to close the dialog."
  	self setMessageParameters.	
  	^ messageMorph!

Item was changed:
  ----- Method: DialogWindow>>message: (in category 'accessing') -----
  message: aStringOrText
  
  	aStringOrText size > 900 ifTrue: [
  		"NOTE THAT this is an awkward compromise for clients misusing the medium of a dialog window. Because of a dialog's rather short lifespan, users should only be presented with compact content and a concise message. If you notice that your dialog is getting too tall or -- in this case -- wider than usual, please consider rewriting its message."
+ 		self messageMorph averageLineLength: 65].
- 		self messageMorph numCharactersPerLine: 65].
  		
  	messageMorph contents: aStringOrText.
  	self setMessageParameters.!

Item was changed:
  ----- Method: NewBalloonMorph>>initialize (in category 'initialization') -----
  initialize
  
  	super initialize.
  	self disableLayout: true.
  	self morphicLayerNumber: self class balloonLayer.
  	
  	self setDefaultParameters.
  	
  	textMorph := TextMorph new
  		hResizing: #shrinkWrap; vResizing: #shrinkWrap;
+ 		averageLineLength: Preferences maxBalloonHelpLineLength;
- 		numCharactersPerLine: Preferences maxBalloonHelpLineLength;
  		lock;
  		yourself.
  	
  	self addMorph: textMorph.!

Item was changed:
  ----- Method: PluggableTextMorph class>>updateCodePanes (in category 'preferences') -----
  updateCodePanes
  
  
  	self flag: #todo. "mt Only for code panes!!"
  	
  	self softLineWrapAtVisualWrapBorder
  		ifTrue: [
  			PluggableTextMorph allSubInstancesDo: [:m |
  				(m styler class = (TextStyler for: #Smalltalk)) ifTrue: [
  					m
  						wantsWrapBorder: self visualWrapBorder;
+ 						averageLineLength: self visualWrapBorderLimit]]]
- 						numCharactersPerLine: self visualWrapBorderLimit]]]
  		ifFalse: [
  			PluggableTextMorph allSubInstancesDo: [:m |
  				(m styler class = (TextStyler for: #Smalltalk)) ifTrue: [
  					m
  						wantsWrapBorder: self visualWrapBorder;
+ 						averageLineLength: nil;
- 						numCharactersPerLine: nil;
  						changed "redraw #visualWrapBorderLimit"]]].!

Item was changed:
  ----- Method: PluggableTextMorph>>drawWrapBorderOn: (in category 'drawing') -----
  drawWrapBorderOn: aCanvas
  
  	| box offset rect |
  	self wantsWrapBorder ifFalse: [^ self].
  	textMorph ifNil: [^ self].
  	
  	box := textMorph innerBounds.
  	textMorph margins ifNotNil: [:m | box := box insetBy: m].
  	
  	offset := box left + (textMorph textStyle compositionWidthFor: self class
  visualWrapBorderLimit).
+ 	self averageLineLength ifNotNil: [
- 	self numCharactersPerLine ifNotNil: [
  		"Respect right margins only if we wrap at that border to not draw over glyphs."
  		offset := offset + (textMorph innerBounds right - box right) + self borderWidth].
  	offset > scroller width ifTrue: [^ self].
  	
  	rect := scroller topLeft + (offset @ 0) corner: scroller bottomRight.
  
  	aCanvas
  		fillRectangle: rect
  		color: self wrapBorderColor.
  	aCanvas
  		line: rect topLeft
  		to: rect bottomLeft
  		width: self borderWidth
  		color: (self wrapBorderColor muchDarker alpha: 0.5).!

Item was changed:
  ----- Method: TextMorph>>withNoLineLongerThan: (in category 'converting') -----
  withNoLineLongerThan: numChars
  	"Convenience only to establish this protocol across String, Text, and TextMorph."
  
+ 	self averageLineLength: numChars.
- 	self numCharactersPerLine: numChars.
  	^ self paragraph asTextWithLineBreaks!



More information about the Squeak-dev mailing list