[squeak-dev] The Trunk: Morphic-tpr.2062.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jan 16 01:55:16 UTC 2023


tim Rowledge uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-tpr.2062.mcz

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

Name: Morphic-tpr.2062
Author: tpr
Time: 15 January 2023, 5:55:05.184058 pm
UUID: 54eed292-3382-4612-ba90-ac754dab6a07
Ancestors: Morphic-mt.2061

Remove some variable shadowing

=============== Diff against Morphic-mt.2061 ===============

Item was changed:
  ----- Method: BorderedMorph>>doFastWindowReframe: (in category 'resize handling') -----
  doFastWindowReframe: ptName
  
  	| newBounds delta |
  	"For fast display, only higlight the rectangle during loop"
+ 	newBounds := self bounds newRectButtonPressedDo:
+ 		[:f | 
- 	newBounds := self bounds newRectButtonPressedDo: [:f | 
  		f 
  			withSideOrCorner: ptName
  			setToPoint: (self pointFromWorld: Sensor cursorPoint)
  			minExtent: self minimumExtent].
  	delta := newBounds origin - self bounds origin.
  	self bounds: newBounds.
+ 
  	self flag: #workaround. "mt: Due to a layout-specific 'let us start in the top-left corner of a layout cell'-behavior, we have to go up the owner chain and propagate the delta. See Morph >> #layoutInBounds:positioning: and there section 1.2."
+ 
+ 	self allOwnersDo:
+ 		[:thisOwner |
+ 		(thisOwner layoutPolicy notNil and: [thisOwner ~~ Project current world])
+ 			ifTrue: [thisOwner topLeft: owner topLeft + delta]].
- 	self allOwnersDo: [:owner |
- 		(owner layoutPolicy notNil and: [owner ~~ Project current world])
- 			ifTrue: [owner topLeft: owner topLeft + delta]].
  	^newBounds.!

Item was changed:
  ----- Method: DockingBarMenuMorph>>popUpAdjacentTo:forHand:from: (in category 'as yet unclassified') -----
  popUpAdjacentTo: rightOrLeftPoint forHand: hand from: sourceItem
  
  	| ownerInWorld world |
  	super popUpAdjacentTo: rightOrLeftPoint forHand: hand from: sourceItem.
  	
  	"Docking bar and protruding menu should appear visually merged. Move the source item behind the receiver. If we did it the other way around, other navigators and docking bars in front of the sourceItem would cover the receiver. For the same reason, we can't use a higher different morphic layer numbers for docking bar menus because this would hide them after all other navigators."
  	world := owner world.
+ 	ownerInWorld := sourceItem firstOwnerSuchThat: [:thisOwner | thisOwner owner == world].
- 	ownerInWorld := sourceItem firstOwnerSuchThat: [:owner | owner owner == world].
  	world addMorph: ownerInWorld inFrontOf: self.!

Item was changed:
  ----- Method: IndentingListItemMorph>>charactersOccluded (in category 'private') -----
  charactersOccluded
  	"Answer the number of characters occluded in my #visibleList by my right edge."
  	| listIndex leftEdgeOfRightmostColumn eachString indexOfLastVisible iconWidth totalWidth |
  	listIndex := 0.
  	leftEdgeOfRightmostColumn := container columns
  		ifNil: [ 0 ]
  		ifNotNil:
+ 			[:cols | (1 to: cols size - 1)
- 			[ : cols | (1 to: cols size - 1)
  				inject: 0
+ 				into: [:sum :each | sum + (self widthOfColumn: each) ] ].
- 				into:
- 					[ : sum : each | sum + (self widthOfColumn: each) ] ].
  	eachString := container columns
  		ifNil: [ self complexContents asString ]
  		ifNotNil:
+ 			[:cols | self contentsAtColumn: container columns size ].
- 			[ : cols | self contentsAtColumn: container columns size ].
  	iconWidth := self icon
  		ifNil: [ 0 ]
  		ifNotNil:
+ 			[:theIcon | theIcon width + 2 ].
- 			[ : icon | icon width + 2 ].
  	totalWidth := self toggleBounds right.
  	indexOfLastVisible := ((1 to: eachString size)
  		detect:
+ 			[:stringIndex | (totalWidth := totalWidth +
+ 				(self fontToUse widthOf: (eachString at: stringIndex))) > (container width - (container vIsScrollbarShowing
- 			[ : stringIndex | (totalWidth:=totalWidth+(self fontToUse widthOf: (eachString at: stringIndex))) >
- 				(container width -
- 					(container vIsScrollbarShowing
  						ifTrue: [ container vScrollBar width ]
  						ifFalse: [ 0 ]) - iconWidth - leftEdgeOfRightmostColumn) ]
  		ifNone: [ eachString size + 1 ]) - 1.
  	^ eachString size - indexOfLastVisible!

Item was changed:
  ----- Method: LazyListMorph>>drawOn: (in category 'drawing') -----
  drawOn: aCanvas
  
  	| topRow bottomRow |
+ 	self backgroundColor ifNotNil:
+ 		[:bkgndColor |
+ 		aCanvas fillRectangle: (self topLeft corner: self right @ ((self owner ifNil: [self]) bottom)) color: bkgndColor].
- 	self backgroundColor ifNotNil: [:color |
- 		aCanvas fillRectangle: (self topLeft corner: self right @ ((self owner ifNil: [self]) bottom)) color: color].
  
  	self getListSize = 0 ifTrue: [ ^self ].
  	
  	self drawPreSelectionOn: aCanvas.
  	
  	topRow := self topVisibleRowForCanvas: aCanvas.
  	bottomRow := self bottomVisibleRowForCanvas: aCanvas.
  
  	"Draw multi-selection."
+ 	self listSource hasMultiSelection ifTrue: 
+ 		[topRow to: bottomRow do:
+ 			[:row |
+ 			(self listSource itemSelectedAmongMultiple: row) ifTrue:
+ 				[self drawBackgroundForMulti: row on: aCanvas]]].
- 	self listSource hasMultiSelection ifTrue: [
- 		topRow to: bottomRow do: [ :row |
- 			(self listSource itemSelectedAmongMultiple: row) ifTrue: [
- 				self drawBackgroundForMulti: row on: aCanvas ] ] ].
  	self drawSelectionOn: aCanvas.
  
  	"Draw hovered row if preference enabled."
+ 	PluggableListMorph highlightHoveredRow ifTrue:
+ 		[self listSource hoverRow > 0 ifTrue:
+ 			[self highlightHoverRow: listSource hoverRow on: aCanvas ]].
- 	PluggableListMorph highlightHoveredRow ifTrue: [
- 		self listSource hoverRow > 0 ifTrue: [
- 			self highlightHoverRow: listSource hoverRow on: aCanvas ] ].
  
  	"Draw all visible rows."
+ 	topRow to: bottomRow do:
+ 		[:row |
- 	topRow to: bottomRow do: [ :row |
  		self display: (self item: row) atRow: row on: aCanvas ].
  
  	"Finally, highlight drop row for drag/drop operations.."
+ 	self listSource potentialDropRow > 0 ifTrue:
+ 		[self highlightPotentialDropRow: self listSource potentialDropRow on: aCanvas ].!
- 	self listSource potentialDropRow > 0 ifTrue: [
- 		self highlightPotentialDropRow: self listSource potentialDropRow on: aCanvas ].!

Item was changed:
  ----- Method: MenuMorph>>invokeAt:in:allowKeyboard: (in category 'modal control') -----
  invokeAt: aPoint in: aWorld allowKeyboard: aBoolean
  	"Add this menu to the given world centered at the given point. Wait for the user to make a selection and answer it. The selection value returned is an integer in keeping with PopUpMenu, if the menu is converted from an MVC-style menu."
  	"Details: This is invoked synchronously from the caller. In order to keep processing inputs and updating the screen while waiting for the user to respond, this method has its own version of the World's event loop." 
+ 	| w |
- 	| w originalFocusHolder |
- 	originalFocusHolder := aWorld primaryHand keyboardFocus.
  	self popUpAt: aPoint forHand: aWorld primaryHand in: aWorld allowKeyboard: aBoolean.
  	w := aWorld outermostWorldMorph. "containing hand"
+ 	[self isInWorld] whileTrue:
+ 		[w doOneSubCycle].
+ 	self delete!
- 	[self isInWorld] whileTrue: [w doOneSubCycle].
- 	self delete.
- 	originalFocusHolder ifNotNil: [aWorld primaryHand newKeyboardFocus: originalFocusHolder].
- !

Item was changed:
  ----- Method: PluggableListMorph>>getFilteredList (in category 'model access - cached') -----
  getFilteredList
  	"Apply the current filter to the list. Maybe shorten the filter term if there are no matches."
  	
+ 	|  filteredList |
+ 	self getFullList ifEmpty: [^ fullList].
- 	| fullList filteredList |
- 	fullList := self getFullList.
  		
  	self hasFilter ifFalse: [^ fullList].
- 	fullList ifEmpty: [^ fullList].
  	
  	filteredList := self filterList: fullList matching: lastKeystrokes.
  	
  	(filteredList isEmpty not or: [ self allowEmptyFilterResult ])
  		ifFalse: 
  			[ "Remove the last character and try filtering again."
  			lastKeystrokes := lastKeystrokes allButLast: 1.
  			^ self
  				 flash;
  				 getFilteredList ].
  			
  	^ filteredList!

Item was changed:
  ----- Method: PluggableMultiColumnListMorph>>getFilteredList (in category 'filtering') -----
  getFilteredList
  	"Apply the current filter to the list. Maybe shorten the filter term if there are no matches."
  	
+ 	| filteredList |
+ 	self getFullList.
- 	| fullList filteredList |
- 	fullList := self getFullList.
  		
  	self hasFilter ifFalse: [^ fullList].
  	fullList ifEmpty: [^ fullList].
  	fullList first ifEmpty: [^ fullList].
  	
  	filteredList := self filterList: fullList matching: lastKeystrokes.
  	
+ 	(filteredList first isEmpty not or: [ self allowEmptyFilterResult ]) ifFalse: 
+ 		[ "Remove the last character and try filtering again."
+ 		lastKeystrokes := lastKeystrokes allButLast: 1.
+ 		^ self
+ 			 flash;
+ 			 getFilteredList ].
- 	(filteredList first isEmpty not or: [ self allowEmptyFilterResult ])
- 		ifFalse: 
- 			[ "Remove the last character and try filtering again."
- 			lastKeystrokes := lastKeystrokes allButLast: 1.
- 			^ self
- 				 flash;
- 				 getFilteredList ].
  			
  	^ filteredList!

Item was changed:
  ----- Method: PluggableMultiColumnListMorph>>hoverRow: (in category 'accessing') -----
  hoverRow: viewIndex
  
  	hoverRow = viewIndex ifTrue: [^ self].
+ 	listMorphs do:
+ 		[:lMorph |
+ 		lMorph rowChanged: hoverRow with: viewIndex].
- 	listMorphs do: [:listMorph |
- 		listMorph rowChanged: hoverRow with: viewIndex].
  	super hoverRow: viewIndex.!

Item was changed:
  ----- Method: PluggableMultiColumnListMorph>>rowAboutToBecomeSelected: (in category 'selection') -----
  rowAboutToBecomeSelected: anInteger
  
+ 	listMorphs do:
+ 		[:lMorph |
+ 		lMorph preSelectedRow: anInteger].
- 	listMorphs do: [:listMorph | listMorph preSelectedRow: anInteger].
  	super rowAboutToBecomeSelected: anInteger.!

Item was changed:
  ----- Method: PluggableMultiColumnListMorph>>rowAtLocation: (in category 'accessing - items') -----
  rowAtLocation: aPoint
  	"Return the row at the given point or 0 if outside"
  
  	| pointInListMorphCoords rowIndex |
  	pointInListMorphCoords := (self scroller transformFrom: self) transform: aPoint.
  
+ 	listMorphs do:
+ 		[:lMorph |
+ 		rowIndex := lMorph rowAtLocation: pointInListMorphCoords.
- 	listMorphs do: [:listMorph |
- 		rowIndex := listMorph rowAtLocation: pointInListMorphCoords.
  		rowIndex > 0 ifTrue: [^ rowIndex]].
  
  	^ 0
  !

Item was changed:
  ----- Method: PluggableMultiColumnListMorph>>selectionIndex: (in category 'selection') -----
  selectionIndex: viewIndex
  
+ 	listMorphs do:
+ 		[:lMorph |
+ 		lMorph selectedRow: (viewIndex min: self listSize)].	
- 	listMorphs do: [:listMorph | listMorph selectedRow: (viewIndex min: self listSize)].	
  	
  	"ct: As per the invariant defined in #setListParameters, listMorphs always includes listMorph. Subsequently, every super send in #selectionIndex: would be without effect because #selectionIndex already has been updated in the child class. Since selection highlighting is also not relevant for multi-column list morphs (this hook is only used by SimpleHierarchicalListMorph), we can refuse this bequest but send #scrollSelectionIntoView manually."
+ 
  	self scrollSelectionIntoView.!

Item was changed:
  ----- Method: PluggableMultiColumnListMorph>>textColor: (in category 'initialization') -----
  textColor: aColor
  
+ 	listMorphs do:
+ 		[:lMorph |
+ 		lMorph color: aColor].
- 	listMorphs do: [:listMorph | listMorph color: aColor].
  	super textColor: aColor.!

Item was changed:
  ----- Method: PluggableMultiColumnListMorph>>updateColumns (in category 'updating') -----
  updateColumns
  	"The number of columns must match the number of list morphs."
  	
  	| columnsChanged |
  	columnsChanged := self columnCount ~= listMorphs size.
  	
+ 	[self columnCount < listMorphs size] whileTrue:
+ 		[listMorphs removeLast delete].
- 	[self columnCount < listMorphs size]
- 		whileTrue: [
- 			listMorphs removeLast delete].
  	
+ 	[self columnCount > listMorphs size] whileTrue: 
+ 		[listMorphs addLast: self createListMorph.
+ 		self scroller addMorphBack: listMorphs last].
- 	[self columnCount > listMorphs size]
- 		whileTrue: [
- 			listMorphs addLast: self createListMorph.
- 			self scroller addMorphBack: listMorphs last].
  	
+ 	listMorphs withIndexDo:
+ 		[:lMorph :columnIndex |
+ 		lMorph
- 	listMorphs withIndexDo: [:listMorph :columnIndex |
- 		listMorph
  			columnIndex: columnIndex;
  			color: self textColor;
  			cellPositioning: (self cellPositioningAtColumn: columnIndex);
  			cellInset: (self cellInsetAtColumn: columnIndex);
  			hResizing: (self hResizingAtColumn: columnIndex);
  			spaceFillWeight: (self spaceFillWeightAtColumn: columnIndex)].
  		
  	columnsChanged ifTrue: [self setListParameters].!

Item was changed:
  ----- Method: SystemWindow>>paneColorToUseWhenNotActive (in category 'colors') -----
  paneColorToUseWhenNotActive
  
+ 	^ (self userInterfaceTheme unfocusedWindowColorModifier ifNil: [ [:col | col darker] ])
- 	^ (self userInterfaceTheme unfocusedWindowColorModifier ifNil: [ [:color | color darker] ])
  		value: self paneColorToUse!



More information about the Squeak-dev mailing list