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

commits at source.squeak.org commits at source.squeak.org
Fri Sep 20 17:33:05 UTC 2019


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

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

Name: Morphic-mt.1526
Author: mt
Time: 20 September 2019, 7:32:57.883764 pm
UUID: bc706b68-7e7e-dc44-a2a7-07af99cbb7f8
Ancestors: Morphic-mt.1525

Cleans up methods for scroll-range calculation in scroll panes.

=============== Diff against Morphic-mt.1525 ===============

Item was removed:
- ----- Method: PluggableListMorph>>hExtraScrollRange (in category 'scrolling') -----
- hExtraScrollRange
- 	"Return the amount of extra blank space to include to the right of the scroll content."
- 	^5 
- !

Item was changed:
  ----- Method: PluggableListMorph>>hUnadjustedScrollRange (in category 'scroll cache') -----
  hUnadjustedScrollRange
+ 	"Override because our lazy list approximates the width for performance reasons."
- 	"Return the entire scrolling range."
  
  	 self resetHScrollRangeIfNecessary.
  
  	^hScrollRangeCache second
  !

Item was removed:
- ----- Method: PluggableListMorph>>vUnadjustedScrollRange (in category 'scrolling') -----
- vUnadjustedScrollRange
- 	"Return the height extent of the receiver's submorphs."
- 	(scroller submorphs size > 0) ifFalse:[ ^0 ].
- 	^(scroller submorphs last fullBounds bottom)
- !

Item was changed:
  ----- Method: ScrollPane>>hUnadjustedScrollRange (in category 'geometry ranges') -----
  hUnadjustedScrollRange
  	"Return the width extent of the receiver's submorphs."
  
+ 	^ scroller localSubmorphBounds width!
- 	| submorphBounds |
- 	submorphBounds := scroller localSubmorphBounds ifNil: [^ 0].
- 	^ submorphBounds right
- !

Item was changed:
  ----- Method: ScrollPane>>vUnadjustedScrollRange (in category 'geometry ranges') -----
  vUnadjustedScrollRange
  	"Return the height extent of the receiver's submorphs."
+ 
+ 	^ scroller localSubmorphBounds height!
- 	| submorphBounds |
- 	submorphBounds := scroller localSubmorphBounds ifNil: [^ 0].
- 	^ submorphBounds bottom
- !

Item was removed:
- ----- Method: SimpleHierarchicalListMorph>>hExtraScrollRange (in category 'scrolling') -----
- hExtraScrollRange
- 	"Return the amount of extra blank space to include below the bottom of the scroll content."
- 	^5
- !

Item was changed:
  ----- Method: SimpleHierarchicalListMorph>>hUnadjustedScrollRange (in category 'scrolling') -----
  hUnadjustedScrollRange
  "Return the width of the widest item in the list"
  
  	| max count |
+ 	self flag: #tofix. "mt: What about icons and columns? Do we ever show horizontal scroll bars for such tree views anyway? Maybe just return 0?"
+ 	
- 
  	max := 0.
  	count := 0.
  	scroller submorphsDo: [ :each | | stringW right |
  		stringW := each font widthOfStringOrText: each contents.
  		right := (each toggleRectangle right + stringW + 10).
  		max := max max: right.
  		
  "NOTE: need to optimize this method by caching list item morph widths (can init that cache most efficiently in the #list: method before the item widths are reset to 9999).  For now, just punt on really long lists"
  		((count := count + 1) > 200) ifTrue:[ ^max * 3].
  	].
  
  	^max 
  !

Item was removed:
- ----- Method: SimpleHierarchicalListMorph>>vUnadjustedScrollRange (in category 'scrolling') -----
- vUnadjustedScrollRange
- "Return the width of the widest item in the list"
- 
- 	(scroller submorphs size > 0) ifFalse:[ ^0 ].
- 	^scroller submorphs last fullBounds bottom
- !

Item was changed:
  ----- Method: TransformMorph>>layoutBounds (in category 'layout') -----
  layoutBounds
+ 	"Ignore scaling and offset but move to local origin for my children as reference point. Note that we do not have to adapt #submorphBoundsForShrinkWrap because those are already in local coordinates. See #adjustLayoutBounds and #setLayoutBoundsFromLayout:"
- 	"Ignore scaling and offset but move to local origin for my children as reference point. Note that we do not have to adapt #submorphBoundsForShrinkWrap because those are already in local coordinates."
  	
  	^ super layoutBounds translateBy: self topLeft negated!

Item was changed:
  ----- Method: TransformMorph>>localSubmorphBounds (in category 'geometry') -----
  localSubmorphBounds
  	"Answer, in my coordinate system, the bounds of all my submorphs (or nil if no submorphs). We will cache this value for performance. The value is invalidated upon recieving #layoutChanged."
  
+ 	^ localBounds ifNil: [localBounds := super submorphBounds]!
- 	localBounds ifNil:[
- 		self submorphsDo:[:m |
- 			localBounds ifNil: [localBounds := m fullBounds]
- 						ifNotNil: [localBounds := localBounds quickMerge: m fullBounds]].
- 	].	
- 
- 	^ localBounds!

Item was removed:
- ----- Method: TransformMorph>>localVisibleSubmorphBounds (in category 'geometry') -----
- localVisibleSubmorphBounds
- 	"Answer, in my coordinate system, the bounds of all my visible submorphs (or nil if no visible submorphs)"
- 	| subBounds |
- 	subBounds := nil.
- 	self submorphsDo: [:m |
- 		(m visible) ifTrue: [
- 			subBounds
- 				ifNil: [subBounds := m fullBounds copy]
- 				ifNotNil: [subBounds := subBounds quickMerge: m fullBounds]]
- 			].
- 	^subBounds!

Item was changed:
  ----- Method: TransformMorph>>submorphBounds (in category 'layout') -----
  submorphBounds
  	"Answer, in owner coordinates, the bounds of my visible submorphs, or my bounds"
  	| box |
+ 	box := self localSubmorphBounds.
- 	box := self localVisibleSubmorphBounds.
  	^(box ifNotNil: [ transform localBoundsToGlobal: box ] ifNil: [ self bounds ]) truncated.
  !



More information about the Squeak-dev mailing list