Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
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@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@delta y) corner: oldBounds corner + (delta x @ 0))! |
Hi Marcel,
thanks for these fixes! :-)
A few additional notes about DialogWindows in general:
Christoph
Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 12. Januar 2021 14:52 Uhr An: [hidden email]; [hidden email] 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 ==================== 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@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@delta y) corner: oldBounds corner + (delta x @ 0))!
Carpe Squeak!
|
> 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
|
Free forum by Nabble | Edit this page |