[squeak-dev] The Trunk: System-mt.1331.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Mar 28 09:03:25 UTC 2022

Marcel Taeumel uploaded a new version of System to project The Trunk:

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

Name: System-mt.1331
Author: mt
Time: 28 March 2022, 11:03:20.99909 am
UUID: ad69b8ce-b5e7-4343-a205-89bf6a262623
Ancestors: System-mt.1330

When changing the #uiScaleFactor, resize the window/world if not already done by the platform.

=============== Diff against System-mt.1330 ===============

Item was changed:
  ----- Method: UserInterfaceTheme>>fixFontsAndScaleAround: (in category 'private - fonts') -----
  fixFontsAndScaleAround: applyThemeBlock
  	"Given that the receiver is the current UI theme, set the system's default fonts, which define RealEstateAgent's #scaleFactor. If the factor changes, resize open windows to make them fit the scaled contents. Note that themes can have arbitrary point sizes for their system font, even though it is not recommended. See TTCFont class >> #referencePointSize."
  	lastScaleFactor ifNil: [lastScaleFactor := RealEstateAgent scaleFactor].
  	"Due to the current font situation, update TextConstants."
  	(self get: #standardSystemFont) ifNotNil: [:font | self installSystemFont: font].
  	(self get: #standardFixedFont) ifNotNil: [:font | self installFixedFont: font].	
  	"Propagate the receiver's properties across the system."
  	applyThemeBlock value.
  	"Due to the current real-estate manager situation, resize all windows. Works only for Morphic projects."
+ 	self scaleMorphicWorldBy: RealEstateAgent scaleFactor / lastScaleFactor.
  	self scaleMorphicToolsBy: RealEstateAgent scaleFactor / lastScaleFactor.
  	lastScaleFactor := nil.!

Item was added:
+ ----- Method: UserInterfaceTheme>>scaleMorphicWorldBy: (in category 'private - fonts') -----
+ scaleMorphicWorldBy: factor
+ 	(factor closeTo: 1) ifTrue: [^ self].
+ 	self flag: #todo. "mt: Once the UserInterfaceTheme does not fake any scale factors anymore and we are all-in with #isTTCBased, the following code can be moved to Project >> #displayScaleChangedFrom:to:. Note that we can stop faking when a low-resolution TTCFont starts looking okay but for now, we rely on pre-rendered StrikeFont."
+ 	(DisplayScreen displayIsFullScreen not
+ 		and: [Display extent = DisplayScreen actualScreenSize])
+ 			ifTrue: [ "The platform has not (yet?) adapted the window size but maybe the #platformScaleFactor. So we have to change the window size now to account for re-scaled tools. Note that projects should do #checkForNewScreenScaleFactor *before* #checkForNewScreenSize."
+ 				DisplayScreen setNewScreenSize: (Display extent * factor) rounded].!

More information about the Squeak-dev mailing list