[squeak-dev] The Inbox: ToolBuilder-Morphic-ct.317.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Thu May 19 13:48:15 UTC 2022


Before:

[cid:c75da1d0-da3f-4159-a7aa-dc1c11ce13bc]


After:

[cid:f599213d-5975-464b-8c55-7c17433719f3]

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Donnerstag, 19. Mai 2022 15:47:50
An: squeak-dev at lists.squeakfoundation.org
Betreff: [squeak-dev] The Inbox: ToolBuilder-Morphic-ct.317.mcz

A new version of ToolBuilder-Morphic was added to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Morphic-ct.317.mcz

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

Name: ToolBuilder-Morphic-ct.317
Author: ct
Time: 19 May 2022, 3:47:49.33378 pm
UUID: 5229468a-f32e-ea4a-89f6-fde8487dda34
Ancestors: ToolBuilder-Morphic-mt.316

Proposal: Do not limit the average line length of a pluggable dialog window's message unnecessarily when a larger initial extent was specified.

For later, it would be nice if we had normal window grips instead and the message text would always wrap automatically.

Is there a better pattern for computing the inverse of averageLineLength?

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

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: [self dialogPadding]).
         widget morphicLayerNumber: widget class dialogLayer.

         "Performance. Flip the #wantsPaneSplitters flag only after all children where added."
         widget paneMorph cellGap: 0.
         widget paneMorph wantsPaneSplitters: false; wantsGrips: false.
         widget paneMorph removePaneSplitters; removeGrips.

         "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].

         "Avoid strange behavior in #addMorph:fullFrame:"
         widget paneMorph cellGap: (aSpec spacing ifNil: [self dialogSpacing]).
         widget paneMorph wantsPaneSplitters: (aSpec wantsResizeHandles ifNil: [true]).
         widget paneMorph wantsPaneSplitters ifTrue: [
                 widget paneMorph wantsGrips: true.
                 widget paneMorph addPaneSplitters; addCornerGrips"; addEdgeGrips".
                 widget paneMorph grips do: [:ea | ea showHandle: true]].

+        widget updateAverageLineLength.
-        "Increase the line width of the dialog's message to allow that longer messages accompany complex paneMorph contents."
-        widget messageMorph averageLineLength: 65.

         "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!

Item was added:
+ ----- Method: PluggableDialogWindow>>updateAverageLineLength (in category 'updating') -----
+ updateAverageLineLength
+        "Increase the line width of the dialog's message to allow that longer messages accompany complex paneMorph contents."
+
+        | message |
+        message := self messageMorph.
+        message averageLineLength:
+                (65 max:
+                        (self initialExtent x / (message textStyle compositionWidthFor: 1))).!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220519/548ab00a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 10024 bytes
Desc: pastedImage.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220519/548ab00a/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 9999 bytes
Desc: pastedImage.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220519/548ab00a/attachment-0001.png>


More information about the Squeak-dev mailing list