[squeak-dev] The Trunk: Morphic-ct.2048.mcz
Thiede, Christoph
Christoph.Thiede at student.hpi.uni-potsdam.de
Mon Oct 10 20:02:26 UTC 2022
> This also fixes some toolbuilding issues for huge scale factors (even though most default values (e.g., ScrollPane>>#defaultExtent) will be overridden by the ToolBuilder, they are still present before a morph is finally layouted).
Here is a more detailed description of these issues:
For a huge scale factor such as 1000%, lists had an unintended extra offset when the model indicated a selection during initial construction, as illustrated in the attached screenshot. This was caused by too-low lists (see ScrollPane>>defaultExtent). I'm still not sure whether it is a general issue that lists might be scaled up after the send to #updateListSelection ...
Best,
Christoph
[cid:f8bb52ae-0422-4ddf-b351-2079c06e40e8]
________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Montag, 10. Oktober 2022 15:13:27
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
Betreff: [squeak-dev] The Trunk: Morphic-ct.2048.mcz
Christoph Thiede uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.2048.mcz
==================== Summary ====================
Name: Morphic-ct.2048
Author: ct
Time: 10 October 2022, 3:13:21.840054 pm
UUID: c9b105e6-27ff-4247-b606-c6414ecbdfe6
Ancestors: Morphic-ct.2047
Makes ScrollPane and MenuItemMorph high-dpi-sensitive. This also fixes some toolbuilding issues for huge scale factors (even though most default values (e.g., ScrollPane>>#defaultExtent) will be overridden by the ToolBuilder, they are still present before a morph is finally layouted).
=============== Diff against Morphic-ct.2047 ===============
Item was changed:
----- Method: MenuItemMorph>>contentString: (in category 'accessing') -----
contentString: aString
+ self flag: #ct. "Can we deprecate this?"
aString
ifNil: [self removeProperty: #contentString]
ifNotNil: [self setProperty: #contentString toValue: aString]!
Item was changed:
----- Method: MenuItemMorph>>defaultBounds (in category 'initialization') -----
defaultBounds
"answer the default bounds for the receiver"
+ ^ 0 @ 0 extent: 10 px @ 10 px!
- ^ 0 @ 0 extent: 10 @ 10!
Item was changed:
----- Method: MenuItemMorph>>drawLabelOn: (in category 'drawing') -----
drawLabelOn: aCanvas
| stringBounds |
stringBounds := self bounds.
self hasIcon ifTrue: [
+ stringBounds := stringBounds left: stringBounds left + self iconForm width + 2 px ].
- stringBounds := stringBounds left: stringBounds left + self iconForm width + 2 ].
self hasMarker ifTrue: [
+ stringBounds := stringBounds left: stringBounds left + self submorphBounds width + 8 px ].
- stringBounds := stringBounds left: stringBounds left + self submorphBounds width + 8 ].
aCanvas
drawString: self contents
at: stringBounds left @ (stringBounds center y - (self fontToUse height // 2))
font: self fontToUse
color: self colorToUse.!
Item was changed:
----- Method: MenuItemMorph>>minHeight (in category 'layout') -----
minHeight
| iconHeight |
iconHeight := self hasIcon
+ ifTrue: [self icon height + 2 px]
- ifTrue: [self icon height + 2]
ifFalse: [0].
^ self fontToUse lineGridForMorphs max: iconHeight!
Item was changed:
----- Method: MenuItemMorph>>minWidth (in category 'layout') -----
minWidth
| subMenuWidth iconWidth markerWidth |
subMenuWidth := self hasSubMenu
ifTrue: [ 10 ]
ifFalse: [ 0 ].
iconWidth := self hasIcon
+ ifTrue: [ self icon width + 2 px ]
- ifTrue: [ self icon width + 2 ]
ifFalse: [ 0 ].
markerWidth := self hasMarker
+ ifTrue: [ self submorphBounds width + 8 px ]
- ifTrue: [ self submorphBounds width + 8 ]
ifFalse: [ 0 ].
^(self fontToUse widthOfString: contents)
+ subMenuWidth + iconWidth + markerWidth + self stringMargin!
Item was changed:
----- Method: ScrollPane>>defaultExtent (in category 'initialization') -----
defaultExtent
+ ^150 px @ 120 px!
- ^150 at 120
- !
Item was changed:
----- Method: ScrollPane>>scrollDeltaHeight (in category 'geometry') -----
scrollDeltaHeight
"Return the increment in pixels which this pane should be scrolled (normally a subclass responsibility)."
+ ^ 10 px!
- ^ 10
- !
Item was changed:
----- Method: ScrollPane>>scrollDeltaWidth (in category 'geometry') -----
scrollDeltaWidth
"Return the increment in pixels which this pane should be scrolled (normally a subclass responsibility)."
+ ^ 10 px!
-
- ^10
- !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20221010/f9495760/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 92817 bytes
Desc: pastedImage.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20221010/f9495760/attachment-0001.png>
More information about the Squeak-dev
mailing list
|