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

Marcel Taeumel marcel.taeumel at hpi.de
Mon Jan 25 10:30:27 UTC 2021


> We should (finally) move the grips to the window border itself to make it consistent with regular windows.

It's a compromise. Given the mixed uses of dialog window, having the grips in the inner content makes the code easier to implement. But have a look at it yourself. :-)

> Grips & scrollbars are not hi-dpi-aware.


See "handle length" and "grip thickness" in the preferences. Disabling "scrollbars narrow" can help in hi-dpi. Yet, "ScrollPane class >> #scrollBarThickness" is still hard-coded.

> The minimum extent of the DialogWindow title itself is neither, [...]

Unfortunately, (New)Paragraph cannot avoid sub-word wrapping.

Best,
Marcel
Am 24.01.2021 19:04:08 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:
Hi Marcel,

thanks for these fixes! :-)

A few additional notes about DialogWindows in general:

* We should (finally) move the grips to the window border itself to make it consistent with regular windows.
* Grips & scrollbars are not hi-dpi-aware.
* The minimum extent of the DialogWindow title itself is neither, I think:

:-)
[http://www.hpi.de/]

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: Dienstag, 12. Januar 2021 14:52 Uhr
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
Betreff: [squeak-dev] The Trunk: Morphic-mt.1716.mcz
 
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1716.mcz [http://source.squeak.org/trunk/Morphic-mt.1716.mcz]

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

Name: Morphic-mt.1716
Author: mt
Time: 12 January 2021, 2:52:47.977356 pm
UUID: 93f95f53-4457-5e4c-a157-5cbf89aa7328
Ancestors: Morphic-mt.1715

Fixes a bug in resize grips (having #rigid targets) that are placed within layouted (usually #shrinkWrap) owners.

This makes all grips in resizable dialogs finally work as expected. I still consider this a #workaround to be improved.

=============== Diff against Morphic-mt.1715 ===============

Item was changed:
  ----- Method: BorderedMorph>>doFastWindowReframe: (in category 'resize handling') -----
  doFastWindowReframe: ptName
 
+        | newBounds delta |
-        | newBounds |
         "For fast display, only higlight the rectangle during loop"
         newBounds := self bounds newRectButtonPressedDo: [:f |
                 f
                         withSideOrCorner: ptName
                         setToPoint: (self pointFromWorld: Sensor cursorPoint)
                         minExtent: self minimumExtent].
+        delta := newBounds origin - self bounds origin.
         self bounds: newBounds.
+        self flag: #workaround. "mt: Due to a layout-specific 'let us start in the top-left corner of a layout cell'-behavior, we have to go up the owner chain and propagate the delta. See Morph >> #layoutInBounds:positioning: and there section 1.2."
+        self allOwnersDo: [:owner |
+                owner layoutPolicy ifNotNil: [owner topLeft: owner topLeft + delta]].
         ^newBounds.!

Item was changed:
  ----- Method: BottomLeftGripMorph>>apply: (in category 'target resize') -----
  apply: delta
         | oldBounds |
         oldBounds := self target bounds.
         self target
+                bounds: (oldBounds origin + (delta x @ 0) corner: oldBounds corner + (0 @ delta y)).
+        self flag: #workaround. "mt: Due to a layout-specific 'let us start in the top-left corner of a layout cell'-behavior, we have to go up the owner chain and propagate the delta. See Morph >> #layoutInBounds:positioning: and there section 1.2."
+        self target allOwnersDo: [:owner |
+                owner layoutPolicy ifNotNil: [owner left: owner left + delta x]].!
-                bounds: (oldBounds origin + (delta x @ 0) corner: oldBounds corner + (0 @ delta y))!

Item was changed:
  ----- Method: LeftGripMorph>>apply: (in category 'target resize') -----
  apply: delta
         | oldBounds |
         oldBounds := self target bounds.
         self target
+                bounds: (oldBounds origin + (delta x @ 0) corner: oldBounds corner).
+        self flag: #workaround. "mt: Due to a layout-specific 'let us start in the top-left corner of a layout cell'-behavior, we have to go up the owner chain and propagate the delta. See Morph >> #layoutInBounds:positioning: and there section 1.2."
+        self target allOwnersDo: [:owner |
+                owner layoutPolicy ifNotNil: [owner left: owner left + delta x]].!
-                bounds: (oldBounds origin + (delta x @ 0) corner: oldBounds corner)!

Item was changed:
  ----- Method: TopGripMorph>>apply: (in category 'target resize') -----
  apply: delta
         | oldBounds |
         oldBounds := self target bounds.
         self target
+                bounds: (oldBounds origin + (0 @ delta y) corner: oldBounds corner).
+        self flag: #workaround. "mt: Due to a layout-specific 'let us start in the top-left corner of a layout cell'-behavior, we have to go up the owner chain and propagate the delta. See Morph >> #layoutInBounds:positioning: and there section 1.2."
+        self target allOwnersDo: [:owner |
+                owner layoutPolicy ifNotNil: [owner top: owner top + delta y]].!
-                bounds: (oldBounds origin + (0 @ delta y) corner: oldBounds corner)!

Item was changed:
  ----- Method: TopLeftGripMorph>>apply: (in category 'target resize') -----
  apply: delta
         | oldBounds |
         oldBounds := self target bounds.
         self target
+                bounds: (oldBounds origin + delta corner: oldBounds corner).
+        self flag: #workaround. "mt: Due to a layout-specific 'let us start in the top-left corner of a layout cell'-behavior, we have to go up the owner chain and propagate the delta. See Morph >> #layoutInBounds:positioning: and there section 1.2."
+        self target allOwnersDo: [:owner |
+                owner layoutPolicy ifNotNil: [owner topLeft: owner topLeft + delta]].!
-                bounds: (oldBounds origin + delta corner: oldBounds corner)!

Item was changed:
  ----- Method: TopRightGripMorph>>apply: (in category 'target resize') -----
  apply: delta
         | oldBounds |
         oldBounds := self target bounds.
         self target
+                bounds: (oldBounds origin + (0 at delta y) corner: oldBounds corner + (delta x @ 0)).
+        self flag: #workaround. "mt: Due to a layout-specific 'let us start in the top-left corner of a layout cell'-behavior, we have to go up the owner chain and propagate the delta. See Morph >> #layoutInBounds:positioning: and there section 1.2."
+        self target allOwnersDo: [:owner |
+                owner layoutPolicy ifNotNil: [owner top: owner top + delta y]].!
-                bounds: (oldBounds origin + (0 at delta y) corner: oldBounds corner + (delta x @ 0))!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210125/29472787/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 6873 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210125/29472787/attachment.png>


More information about the Squeak-dev mailing list