[squeak-dev] The Trunk: Morphic-ct.2047.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Oct 7 13:54:13 UTC 2022


Christoph Thiede uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.2047.mcz

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

Name: Morphic-ct.2047
Author: ct
Time: 7 October 2022, 3:54:09.197686 pm
UUID: f09714d7-8901-ca44-989d-a7556f35a320
Ancestors: Morphic-ct.2046

Makes UpdatingStringMorph high-dpi-sensitive. Amongst others, this makes sure that halo labels are not truncated too early for large scale factors.

=============== Diff against Morphic-ct.2046 ===============

Item was changed:
  ----- Method: NameStringInHalo>>placeContents (in category 'private') -----
  placeContents
  	| namePosition |
  	(owner notNil and: [owner isInWorld]) ifTrue:
  		[namePosition := owner basicBox bottomCenter -
+ 			((self width // 2) @ (owner handleSize negated // 2 - 1 px)).
+ 		namePosition := namePosition min: self world viewBox bottomRight - self extent y + 2 px.
- 			((self width // 2) @ (owner handleSize negated // 2 - 1)).
- 		namePosition := namePosition min: self world viewBox bottomRight - self extent y + 2.
  		self bounds: (namePosition extent: self extent)]!

Item was added:
+ ----- Method: UpdatingStringMorph>>defaultMaximumWidth (in category 'initialization') -----
+ defaultMaximumWidth
+ 
+ 	^ 366 px!

Item was added:
+ ----- Method: UpdatingStringMorph>>defaultMinimumWidth (in category 'initialization') -----
+ defaultMinimumWidth
+ 
+ 	^ 8 px!

Item was changed:
  ----- Method: UpdatingStringMorph>>doneWithEdits (in category 'editing') -----
  doneWithEdits
  	"If in a SyntaxMorph, shrink min width after editing"
  
  	| editor |
  	super doneWithEdits.
+ 	(owner respondsTo: #parseNode) ifTrue: [minimumWidth := self defaultMinimumWidth].
- 	(owner respondsTo: #parseNode) ifTrue: [minimumWidth := 8].
  	editor := (submorphs detect: [ :sm | sm isKindOf: StringMorphEditor ] ifNone: [ ^self ]).
  	editor delete.!

Item was changed:
  ----- Method: UpdatingStringMorph>>initialize (in category 'initialization') -----
  initialize
  	"Initialize the receiver to have default values in its instance variables."
  	super initialize.
  ""
  	format := #default.
  	"formats: #string, #default"
  	target := getSelector := putSelector := nil.
  	floatPrecision := 1.
  	growable := true.
  	stepTime := nil.
  	autoAcceptOnFocusLoss := true.
+ 	minimumWidth := self defaultMinimumWidth.
+ 	maximumWidth := self defaultMaximumWidth.!
- 	minimumWidth := 8.
- 	maximumWidth := 366!

Item was changed:
  ----- Method: UpdatingStringMorph>>minWidth (in category 'accessing') -----
  minWidth
  	"Answer the minimum width that the receiver can have.  A nonzero value here keeps the receiver from degenerating into something that cannot ever be seen or touched again!!  Obeyed by fitContents."
  
+ 	^ minimumWidth ifNil: [minimumWidth := self defaultMinimumWidth]!
- 	^ minimumWidth ifNil: [minimumWidth := 8]!

Item was changed:
  ----- Method: UpdatingStringMorph>>mouseDown: (in category 'event handling') -----
  mouseDown: evt
  	"The mouse went down over the receiver.  If appropriate, launch a mini-editor so that the user can commence text-editing here"
  
  	(owner wantsKeyboardFocusFor: self) ifTrue:
  		[self userEditsAllowed ifTrue:
  			[(owner respondsTo: #parseNode)
  					ifTrue: 	"leave space for editing"
+ 						[minimumWidth := (49 px max: minimumWidth)].
- 						[minimumWidth := (49 max: minimumWidth)].
  			self launchMiniEditor: evt]]!



More information about the Squeak-dev mailing list