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

commits at source.squeak.org commits at source.squeak.org
Thu Nov 25 10:38:14 UTC 2021

Marcel Taeumel uploaded a new version of Morphic to project The Trunk:

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

Name: Morphic-mt.1800
Author: mt
Time: 25 November 2021, 11:38:08.806354 am
UUID: 8f04a38b-0c0b-2946-b7b7-eed85d3fcbbd
Ancestors: Morphic-mt.1799

Always notify models when a window's label (or title) changes, not just in the manual #relabel request. Now models have full control over such a window title, regardless of how the window is opened (e.g., see ToolBuilder class >> #open:label:.

Note that the callback #windowReqNewLabel: could be renamed in the future. Maybe even made configurable like PluggableTextMorph's #setTextSelector (via #acceptTextInModel).

=============== Diff against Morphic-mt.1799 ===============

Item was changed:
  ----- Method: SystemWindow>>relabel (in category 'label') -----
+ 	(Project uiManager
- 	| newLabel |
- 	newLabel := UIManager default 
  		request: 'New title for this window' translated
+ 		initialAnswer: labelString)
+ 			ifNotEmpty: [:newLabel | self setLabel: newLabel].!
- 		initialAnswer: labelString.
- 	newLabel isEmpty ifTrue: [^self].
- 	(model windowReqNewLabel: newLabel)
- 		ifTrue: [self setLabel: newLabel]!

Item was changed:
  ----- Method: SystemWindow>>setLabel: (in category 'label') -----
  setLabel: aString
  	| frame |
+ 	(model windowReqNewLabel: aString) ifFalse: [^ self].
  	labelString := aString.
  	label ifNil: [^ self].
  	label contents: (aString ifNil: ['']).
  	self labelWidgetAllowance.  "Sets it if not already"
  	self isCollapsed
  		ifTrue: [self extent: (label width + labelWidgetAllowance) @ (self labelHeight + 2)]
  		ifFalse: [label fitContents; setWidth: (label width min: self width - labelWidgetAllowance).
  				label align: label bounds topCenter with: self topCenter + (0 at self borderWidth).
  				collapsedFrame ifNotNil:
  					[collapsedFrame := collapsedFrame withWidth: label width + labelWidgetAllowance]].
  	frame := LayoutFrame new.
  	frame leftFraction: 0.5;
  		 topFraction: 0.5;
  		 leftOffset: label width negated // 2;
  		 topOffset: label height negated // 2.
  	label layoutFrame: frame.

Item was changed:
  ----- Method: SystemWindow>>tryToRenameTo: (in category 'label') -----
  tryToRenameTo: newLabel
  	"Triggered eg by typing a new name in the halo"
+ 	newLabel ifNotEmpty: [self setLabel: newLabel].
- 	newLabel isEmpty ifTrue: [^self].
- 	(model windowReqNewLabel: newLabel)
- 		ifTrue: [self setLabel: newLabel]

More information about the Squeak-dev mailing list