The Trunk: ToolBuilder-Morphic-mt.271.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: ToolBuilder-Morphic-mt.271.mcz

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

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

Name: ToolBuilder-Morphic-mt.271
Author: mt
Time: 12 January 2021, 2:09:57.073356 pm
UUID: b77f7e90-6347-f242-8b9b-921013f06122
Ancestors: ToolBuilder-Morphic-mt.270

Removes the "breathing space" in a list-chooser's preferred extent. Thanks to Chris (cbc) for clarifying the issue with the cellInset in LazyListMorph.

Note that I do have a better solution for min/max/preferredExtent in combination with ProportionalLayout and LayoutFrame. Maybe now is the time to invest more time into that.

Also note that I will now investigate that 2-pixel-bug that causes the vertical scroll bar to remain after hitting the expand button in a dialog. It is related to the list's and input-field's borderWidth.

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

Item was changed:
  ----- Method: ListChooser>>initialExtent (in category 'building') -----
  initialExtent
 
  | listFont itemCount maxItemSize cellSize |
  listFont := Preferences standardListFont.
  itemCount := items size.
  maxItemSize := items inject: 0 into: [:max :item | max max: item size].
  cellSize := (listFont widthOf: $m) @ listFont height.
 
+ ^ ((maxItemSize min: 20 max: 10)
+ @ (itemCount min: 15 max: 5)
- ^ ((maxItemSize + 1 "breathing space" min: 20 max: 10)
- @ (itemCount + 1 "breathing space" min: 15 max: 5)
  * cellSize) + (0@ self searchBarHeight)!

Item was changed:
  ----- Method: ListChooser>>preferredExtent (in category 'building') -----
  preferredExtent
 
  | listFont cellSize |
  listFont := Preferences standardListFont.
  cellSize := (listFont widthOf: $m) @ listFont height.
 
  ^  ((items inject: 0 into: [:max :item | max max: (listFont widthOfString: item)])
  @ (items size * listFont height))
- + ((1@1) * cellSize) "breathing space"
  + (0@ self searchBarHeight)!

Item was changed:
  ----- Method: ListMultipleChooser>>initialExtent (in category 'toolbuilder') -----
  initialExtent
 
  | listFont itemCount maxItemSize cellSize |
  listFont := Preferences standardListFont.
  itemCount := labels size.
  maxItemSize := labels inject: 0 into: [:max :item | max max: item size].
  cellSize := (listFont widthOf: $m) @ listFont height.
 
+ ^ ((maxItemSize min: 20 max: 10)
+ @ (itemCount min: 15 max: 5)
- ^ ((maxItemSize + 1 "breathing space" min: 20 max: 10)
- @ (itemCount + 1 "breathing space" min: 15 max: 5)
  * cellSize)!

Item was changed:
  ----- Method: ListMultipleChooser>>preferredExtent (in category 'toolbuilder') -----
  preferredExtent
 
  | listFont cellSize |
  listFont := Preferences standardListFont.
  cellSize := (listFont widthOf: $m) @ listFont height.
 
  ^  ((labels inject: 0 into: [:max :item | max max: (listFont widthOfString: item)])
+ @ (labels size * listFont height))!
- @ (labels size * listFont height))
- + ((1@1) * cellSize) "breathing space"!

Item was changed:
  ----- Method: PluggableDialogWindow>>expandDialogPane (in category 'running') -----
  expandDialogPane
+ "Expand the dialog pane to its preferred extent, including the pane's extra layout inset used for grips. Then try again to move to the dialog's preferred position."
- "Expand the dialog pane to its preferred extent. Honor the visible area in the world."
 
+ | extra |
+ self flag: #preferredExtentWorkaround. "mt: Working with a widget's min, max, and preferred extent is still very awkward using proportional layouts and layout frames. For now, approximate extra spacing to accommodate ListChooser and ListMultipleChooser only."
+ extra := LazyListMorph new cellInset. extra := extra topLeft + extra bottomRight.
- | visibleArea decorationOffset expandedExtent |
- visibleArea := self currentWorld visibleClearArea.
- decorationOffset := self extent - self paneMorph extent.
- expandedExtent := self model preferredExtent + (self paneMorph layoutInset * 2) asPoint.
-
- self paneMorph extent: (expandedExtent min: visibleArea extent - decorationOffset).
 
+ self paneMorph extent:
+ (self model preferredExtent
+ + (self paneMorph layoutInset * 2) asPoint
+ + extra).
- self fullBounds.
  self moveToPreferredPosition.!