[squeak-dev] The Inbox: ToolBuilder-Morphic-cbc.270.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jan 8 19:27:49 UTC 2021


A new version of ToolBuilder-Morphic was added to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Morphic-cbc.270.mcz

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

Name: ToolBuilder-Morphic-cbc.270
Author: cbc
Time: 8 January 2021, 11:27:47.8204 am
UUID: abbbeb8a-9a8b-ef4a-b6a9-051b55cc2d5b
Ancestors: ToolBuilder-Morphic-mt.269

Set the initial extent of the ListChooser to not require resizing the dialog for reasonable sized lists (i.e., expand it so you can see all of the list).
At the small end, still object MT's suggested size; at the large end, will not take up more the 3/4ths of the world size.

=============== Diff against ToolBuilder-Morphic-mt.269 ===============

Item was changed:
  ----- Method: ListChooser>>initialExtent (in category 'building') -----
  initialExtent
+ 	| listFont width height |
- 
- 	| listFont |
  	listFont := Preferences standardListFont.
+ 	width := (items collect: [:item| listFont widthOfString: item]) max + 20 "Acutal size of items plus dialog buffer left/right"
+ 		max: (20 * (listFont widthOf: $m)). "but we want a not-too-small box as well"
+ 	height := ((items size max: 15) * listFont height) + 40. "for various other stuff in dialog above/below list"
+ 	"But, don't use the whole world."
+ 	width := width min: (self currentWorld extent x * 0.75) asInteger.
+ 	height := height min: (self currentWorld extent y * 0.75) asInteger.
+ 	^ width at height!
- 	^ (20 * (listFont widthOf: $m))@(15 * listFont height)!



More information about the Squeak-dev mailing list