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

commits at source.squeak.org commits at source.squeak.org
Mon Dec 6 12:35:47 UTC 2021


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

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

Name: ToolBuilder-Morphic-mt.282
Author: mt
Time: 6 December 2021, 1:35:46.372534 pm
UUID: e5cb2e77-4066-1347-a5fa-89169700258b
Ancestors: ToolBuilder-Morphic-ct.281

Again, fixes some high-dpi scaling issues in dialog windows.

Note that we cannot do that in the tool builder because models might already answer scaled content sizes such as when using the default font metrics already in #initialExtent. See ListChooser >> #initialExtent as an example. Unfortunately, we cannot re-use dialog models in regular (non-dialog / system) windows and vice versa. Luckily, there is no such case at the moment.

Also implement #isMorphicModel in pluggable dialogs to have a richer debug (halo) menu, i.e., "explore model" etc.

=============== Diff against ToolBuilder-Morphic-ct.281 ===============

Item was changed:
  ----- Method: FileAbstractSelectionDialog>>initialExtent (in category 'toolbuilder') -----
  initialExtent
  
+ 	^ (super initialExtent * (0.8 @ 0.7) * RealEstateAgent scaleFactor) truncated!
- 	^ super initialExtent * (0.8 @ 0.7)!

Item was changed:
  ----- Method: MorphicToolBuilder>>buildPluggableDialog: (in category 'widgets optional') -----
  buildPluggableDialog: aSpec
  
  	| widget |
  
  	widget := self dialogClass new.
  	self register: widget id: aSpec name.
  	
  	widget model: aSpec model.
  
  	"Set child dependent layout properties. The pane morph holds the special contents."
  	widget paneMorph wantsPaneSplitters: (aSpec wantsResizeHandles ifNil: [true]).
  	self setLayoutHintsFor: widget paneMorph spec: aSpec.
  	widget paneMorph layoutInset: (aSpec padding ifNil: [ProportionalSplitterMorph gripThickness]).
  	widget paneMorph cellGap: (aSpec spacing ifNil: [ProportionalSplitterMorph gripThickness]).
  	widget morphicLayerNumber: widget class dialogLayer.
  	widget paneMorph wantsPaneSplitters ifTrue: [
  		widget paneMorph addCornerGrips"addEdgeGrips".
  		widget paneMorph grips do: [:ea | ea showHandle: true]].
  
  	"Now create the children."
  	panes := OrderedCollection new.
  	aSpec children isSymbol
  		ifTrue: [
  			widget getChildrenSelector: aSpec children.
  			widget update: aSpec children]
  		ifFalse: [
  			self buildAll: aSpec children in: widget paneMorph].
  
  	"Now create the buttons."
  	aSpec buttons isSymbol
  		ifTrue: [
  			widget getButtonsSelector: aSpec buttons.
  			widget update: aSpec buttons]
  		ifFalse: [
  			self buildAll: aSpec buttons in: widget buttonRowMorph.
  			widget updateButtonProperties].
  
  	aSpec title ifNotNil: [:label |
  		label isSymbol 
  			ifTrue:[widget getTitleSelector: label; update: label]
  			ifFalse:[widget title: label]].
  	aSpec message ifNotNil: [:label |
  		label isSymbol 
  			ifTrue:[widget getMessageSelector: label; update: label]
  			ifFalse:[widget message: label]].
  	
  	"Interaction behavior."
  	aSpec autoCancel ifNotNil: [:b | widget autoCancel: b].
  	aSpec exclusive ifNotNil: [:b | widget exclusive: b].
  		
  	widget closeDialogSelector: aSpec closeAction.
  	self buildHelpFor: widget spec: aSpec. 
  
  	"Everything is shrink-wrapped around the pane morph."
+ 	widget paneMorph extent: (aSpec extent ifNil:[widget initialExtent])
+ 		+ (widget paneMorph layoutInset * 2) asPoint.
- 	widget paneMorph extent: ((aSpec extent ifNil:[widget initialExtent])
- 		+ (widget paneMorph layoutInset * 2) asPoint * RealEstateAgent scaleFactor) truncated.
  
  	^ widget!

Item was changed:
  ----- Method: PluggableDialogWindow>>initialExtent (in category 'initialization') -----
  initialExtent
+ 	"Avoid screen-scaling to let the model determine the best initial extent, which might already be based on visible contents such as texts rendered in the default font."
+ 	
- 
  	^ model initialExtent!

Item was added:
+ ----- Method: PluggableDialogWindow>>isMorphicModel (in category 'testing') -----
+ isMorphicModel
+ 	"I am a MorphicModel because I am a Morph and I offer a #model. Now, my debug menu shows more entries."
+ 
+ 	self flag: #discuss. "mt: Maybe subclass from MorphicModel like SystemWindow?"
+ 	^ true!



More information about the Squeak-dev mailing list