Cuis-Smalltalk-Dev icon indicating copy to clipboard operation
Cuis-Smalltalk-Dev copied to clipboard

Scaling widgets to screen density

Open hilaire opened this issue 5 months ago • 0 comments

Depending on the user selected defaultPointSize, the developer of GUI application should be able to scale their widgets accordingly.

For Dr. Geo I added these two methods to the Theme class, but it should be a system solution because I will have clash when mixing GUI applications code in a single Cuis image:

Theme>>scaled: aFloat
" Scale the length represented by anInteger to the display density "
	^ aFloat * FontFamily defaultPointSize / 12

and

scale: anIntegerOrCollection
" Scale the length represented by anInteger to the display density "
	^ (self scaled: anIntegerOrCollection) rounded

hilaire avatar Aug 31 '24 09:08 hilaire