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

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Mon Feb 7 12:14:53 UTC 2022


Thank you! Maybe we will even be able to implement proper linebreaks for this balloon text at some time ...

[cid:9ebd384a-ca30-47f5-aa02-9e3ead758f62]

What would be the right approach for this? Would it be fair to maintain a second (locked) TextMorph instance for this and always display one of both morphs only? Or should we exchange the state (contents and style) of the existing textMorph instead? Or even maintain another paragraph instance separately? :-)


Best,

Christoph

________________________________
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, 7. Februar 2022 11:20:20
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
Betreff: [squeak-dev] The Trunk: ToolBuilder-Morphic-mt.294.mcz

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

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

Name: ToolBuilder-Morphic-mt.294
Author: mt
Time: 7 February 2022, 11:20:19.442414 am
UUID: 121b5fa3-cc43-ba4e-ac82-90a2b7f7cf77
Ancestors: ToolBuilder-Morphic-mt.293

Fixes regression regarding the vertical position of help text in pluggable text morphs.

=============== Diff against ToolBuilder-Morphic-mt.293 ===============

Item was changed:
  ----- Method: PluggableTextMorphPlus>>drawBalloonTextOn: (in category 'drawing') -----
  drawBalloonTextOn: aCanvas
+        "Show balloon text in the text morph if it has no contents. Catch errors to guard against broken models."
+
+        | helpText helpFont helpColor box |
-        "Show balloon text in the text morph if it has no contents."
         textMorph contents ifNotEmpty: [ ^ self ].
+        helpText := [ self balloonText ] on: Error do: [ :err | '<error in #balloonText>' ].
+        helpText ifNil: [ ^ self ].
+
+        helpFont := self userInterfaceTheme balloonTextFont ifNil: [TextStyle defaultFont].
+        helpColor := self userInterfaceTheme balloonTextColor ifNil: [Color gray: 0.7].
+
+        box := self innerBounds insetBy: (self textMorph margins ifNil: [0]).
+        box := box insetBy: (0 @ helpFont lineGapSlice corner: 0 at 0).
+
+        aCanvas drawString: helpText in: box font: helpFont color: helpColor.!
-        ([ self balloonText ]
-                on: Error
-                do: [ : err | 'error in balloonText' ]) ifNotNil:
-                [ : text | | font box |
-                        font := self userInterfaceTheme balloonTextFont ifNil: [TextStyle defaultFont].
-                        box := self bounds insetBy: (self textMorph margins ifNil: [0]).
-                        box := box insetBy: (0 @ font lineGapSlice corner: 0 at 0).
-                        aCanvas
-                                drawString: text
-                                in: box
-                                font: font
-                                color: (self userInterfaceTheme balloonTextColor ifNil: [Color gray: 0.7]) ]!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220207/9eeba3f9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 3713 bytes
Desc: pastedImage.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220207/9eeba3f9/attachment.png>


More information about the Squeak-dev mailing list