[Pkg] The Trunk: Morphic-mt.1519.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Sep 12 09:45:29 UTC 2019


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

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

Name: Morphic-mt.1519
Author: mt
Time: 12 September 2019, 11:45:13.334062 am
UUID: 5c4b64ee-8cf1-e84b-8ccd-757d32487b80
Ancestors: Morphic-mt.1518

Makes SystemProgressMorph more extensible through subclassing. ...and fixes that label-centering bug. :-)

=============== Diff against Morphic-mt.1518 ===============

Item was added:
+ ----- Method: SystemProgressMorph>>createProgressBar (in category 'private') -----
+ createProgressBar
+ 	
+ 	^ SystemProgressBarMorph new extent: BarWidth at BarHeight!

Item was added:
+ ----- Method: SystemProgressMorph>>createProgressLabel: (in category 'private') -----
+ createProgressLabel: aString
+ 	
+ 	^ (StringMorph contents: aString font: self font)
+ 		color: self textColor;
+ 		yourself!

Item was changed:
  ----- Method: SystemProgressMorph>>initialize (in category 'initialization') -----
  initialize
  	super initialize.
  	activeSlots := 0.
  	bars := Array new: 10.
  	labels := Array new: 10.
  	lock := Semaphore forMutualExclusion.
  	self setDefaultParameters;
  		setProperty: #morphicLayerNumber toValue: self morphicLayerNumber;
  		layoutPolicy: TableLayout new;
  		listDirection: #topToBottom;
+ 		cellPositioning: #topCenter;
- 		cellPositioning: #leftCenter;
  		cellGap: 5;
  		listCentering: #center;
  		hResizing: #shrinkWrap;
  		vResizing: #shrinkWrap;
  		layoutInset: Inset;
  		minWidth: 150!

Item was changed:
  ----- Method: SystemProgressMorph>>nextSlotFor: (in category 'private') -----
  nextSlotFor: shortDescription
  	
  	lock critical: [ | label bar slots |
  		slots := self labels size.
  		self activeSlots = slots ifTrue: [^0].
  		self activeSlots: self activeSlots + 1.
  		1 to: slots do: [:index |
  			label := (self labels at: index).
  			label ifNil: [
+ 				bar := self bars at: index put: self createProgressBar.
+ 				label := self labels at: index put: (self createProgressLabel: shortDescription).
- 				bar := self bars at: index put: (SystemProgressBarMorph new extent: BarWidth at BarHeight).
- 				label := self labels at: index put: ((StringMorph contents: shortDescription font: self font) color: self textColor).
  				self
  					addMorphBack: label;
  					addMorphBack: bar.
  				^index].
  			label owner ifNil: [
  				bar := self bars at: index.
  				label := self labels at: index.
  				self
  					addMorphBack: (label contents: shortDescription);
  					addMorphBack: (bar barSize: 0).
  				^index]]]
  		!



More information about the Packages mailing list