[squeak-dev] The Trunk: Morphic-ct.2034.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Aug 25 10:38:25 UTC 2022


Christoph Thiede uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.2034.mcz

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

Name: Morphic-ct.2034
Author: ct
Time: 25 August 2022, 12:38:20.942239 pm
UUID: fb393ff4-a8fe-6340-8eb7-9e2654cad582
Ancestors: Morphic-ct.2031

Adds and improves high-dpi support for SimpleButtonMorph (revises Morphic-ct.2027) and IconicButton.

=============== Diff against Morphic-ct.2031 ===============

Item was changed:
  ----- Method: IconicButton>>borderNormal (in category 'initialization') -----
  borderNormal
+ 	self borderStyle: (BorderStyle width: 2 px color: Color transparent).!
- 	self borderStyle: (BorderStyle width: 2 color: Color transparent).!

Item was changed:
  ----- Method: IconicButton>>borderThick (in category 'initialization') -----
  borderThick
+ 	self borderStyle: (BorderStyle width: 2 px color: self raisedColor twiceDarker).!
- 	self borderStyle: (BorderStyle width: 2 color: self raisedColor twiceDarker).!

Item was changed:
  ----- Method: IconicButton>>defaultBorderWidth (in category 'initialization') -----
  defaultBorderWidth
+ 	^ 2 px!
- 	^ 2!

Item was changed:
  ----- Method: IconicButton>>initializeWithThumbnail:withLabel:andColor:andSend:to: (in category 'initialization') -----
  initializeWithThumbnail: aThumbnail withLabel: aLabel andColor: aColor andSend: aSelector to: aReceiver 	
  	"Initialize the receiver to show aThumbnail on its face, giving it the label supplied and arranging for it, when the button goes down on it, to obtain a new morph by sending the supplied selector to the supplied receiver"
  
  	| labeledItem nonTranslucent |
  	nonTranslucent := aColor asNontranslucentColor.
  	labeledItem := AlignmentMorph newColumn.
  	labeledItem color: nonTranslucent.
  	labeledItem borderWidth: 0.
  	labeledItem
+ 		layoutInset: 4 px @ 0;
- 		layoutInset: 4 at 0;
  		cellPositioning: #center.
  	labeledItem addMorph: aThumbnail.
+ 	labeledItem addMorphBack: (Morph new extent: (4 px @ 4 px)) beTransparent.
- 	labeledItem addMorphBack: (Morph new extent: (4 at 4)) beTransparent.
  	labeledItem addMorphBack: (TextMorph new
  		backgroundColor: nonTranslucent;
  		contentsAsIs: aLabel;
  		beAllFont: Preferences standardEToysFont;
  		centered).
  
  	self
  		beTransparent;
  		labelGraphic: ((labeledItem imageForm: 32 backgroundColor: nonTranslucent forRectangle: labeledItem fullBounds) replaceColor: nonTranslucent withColor: Color transparent);
  		borderWidth: 0;
  		target: aReceiver;
  		actionSelector: #launchPartVia:label:;
  		arguments: {aSelector. aLabel};
  		actWhen: #buttonDown.
  
  	self stationarySetup.!

Item was changed:
  ----- Method: IconicButton>>labelGraphic: (in category 'label') -----
  labelGraphic: aForm
  	| oldLabel graphicalMorph |
  	(oldLabel := self findA: SketchMorph)
  		ifNotNil: [oldLabel delete].
  	graphicalMorph := SketchMorph withForm: aForm.
+ 	self extent: graphicalMorph extent + (self borderWidth + 6 px).
- 	self extent: graphicalMorph extent + (self borderWidth + 6).
  	graphicalMorph position: self center - (graphicalMorph extent // 2).
  	self addMorph: graphicalMorph.
  	graphicalMorph 
  		baseGraphic;
+ 		lock.!
- 		lock.
- !

Item was changed:
  ----- Method: IconicButton>>shedSelvedge (in category 'ui') -----
  shedSelvedge
+ 	self extent: (self extent - (6 px @ 6 px))!
- 	self extent: (self extent - (6 at 6))!

Item was changed:
  ----- Method: SimpleButtonMorph>>fitContents (in category 'layout') -----
  fitContents
  	| aMorph aCenter |
  	aCenter := self center.
  	self hasSubmorphs ifFalse: [^self].
  	aMorph := self firstSubmorph.
+ 	self extent: aMorph extent + (self borderWidth + 6 px).
- 	self extent: aMorph extent + (self borderWidth + 6).
  	self center: aCenter.
  	aMorph position: aCenter - (aMorph extent // 2)!

Item was changed:
  ----- Method: SimpleButtonMorph>>initializeAllButLabel (in category 'initialization') -----
  initializeAllButLabel
  	super initialize.
  	self
+ 		 borderWidth: 1 px;
- 		 borderWidth: 1 ;
  		 color: (Color r: 0.4 g: 0.8 b: 0.6) ;
  		 borderColor: self color darker ;
  		 borderStyle: BorderStyle thinGray.
  	target := nil.
  	actionSelector := #flash.
  	arguments := Array empty.
  	actWhen := #buttonUp!



More information about the Squeak-dev mailing list