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

commits at source.squeak.org commits at source.squeak.org
Tue Dec 14 11:12:27 UTC 2021


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

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

Name: Morphic-mt.1823
Author: mt
Time: 14 December 2021, 12:12:21.484574 pm
UUID: 13a4c44e-8f27-1843-8f66-6c965ab18771
Ancestors: Morphic-mt.1822

Speed up creation of pluggable buttons ~25%. Make its default inset bigger in high-dpi situations. Make its minimum width bigger for very small labels such as '?' in our code browsers so that users can actually hit the target ;-)

=============== Diff against Morphic-mt.1822 ===============

Item was added:
+ ----- Method: PluggableButtonMorph>>defaultLayoutInset (in category 'layout') -----
+ defaultLayoutInset
+ 
+ 	| inset |
+ 	inset := (4 * RealEstateAgent scaleFactor) truncated.
+ 	^ inset @ 0 corner: inset @ 0!

Item was changed:
  ----- Method: PluggableButtonMorph>>initialize (in category 'initialization') -----
  initialize
  
  	super initialize.
  
  	"Layout properties."
  	self
  		extent: 20 @ 15;
+ 		clipSubmorphs: true.
+ 	
+ 	"Set layout properties directly to avoid unnecessary calls to #updateMinimumExtent. Should be replaced with #assureLayoutProperties in the future."
+ 	self assureTableLayoutProperties
  		hResizing: #shrinkWrap;
  		vResizing: #shrinkWrap;
+ 		layoutInset: self defaultLayoutInset;
- 		layoutInset: (4 at 0 corner: 4 at 0);
- 		clipSubmorphs: true;
  		wrapCentering: #center;
  		cellPositioning: #topCenter.
  	
  	"Initialize instance variables."
  	model := nil.
  	label := nil.
  	getStateSelector := nil.
  	actionSelector := nil.
  	getLabelSelector := nil.
  	getMenuSelector := nil.
  	shortcutCharacter := nil.
  	askBeforeChanging := false.
  	triggerOnMouseDown := false.
  	allButtons := nil.
  	argumentsProvider := nil.
  	argumentsSelector := nil.
  	
  	self setDefaultParameters.
  !

Item was changed:
  ----- Method: PluggableButtonMorph>>updateMinimumExtent (in category 'layout') -----
  updateMinimumExtent
  
  	| hMin vMin |
  	self label isMorph
  		ifTrue: [^ self minimumExtent: self label minExtent].
  
  	hMin := vMin := 0.
  	self hResizing ~~ #spaceFill
+ 		ifTrue: [hMin := (self font widthOfString: self label) max: (self font widthOf: $x) * 3].
- 		ifTrue: [hMin := (self font widthOfString: self label)].
  	self vResizing ~~ #spaceFill
  		ifTrue: [vMin := self font height].
  
  	hMin := hMin + (2* self borderStyle width).
  	vMin := vMin + (2* self borderStyle width).
  			
  	self layoutInset isRectangle
  		ifTrue: [
  			hMin := hMin + self layoutInset left + self layoutInset right.
  			vMin := vMin + self layoutInset top + self layoutInset bottom]
  		ifFalse: [self layoutInset isPoint
  			ifTrue: [
  				hMin := hMin + (2* self layoutInset x).
  				vMin := vMin + (2* self layoutInset y)]
  			ifFalse: [
  				hMin := hMin + (2* self layoutInset).
  				vMin := vMin + (2* self layoutInset)]].
  	
  	self minimumExtent: hMin @ vMin.
  
  	"Since we have no submorphs, we have to resize here if we want to shrink wrap."
  	self hResizing == #shrinkWrap ifTrue: [self width: hMin].
  	self vResizing == #shrinkWrap ifTrue: [self height: vMin].!



More information about the Squeak-dev mailing list