6f2cc2213958 — Gerald Klix (speedy) 3 months ago
SUM: Better inset handling in grid morph.
1 files changed, 17 insertions(+), 7 deletions(-)

M haver/ui/GridLayout.pck.st
M haver/ui/GridLayout.pck.st +17 -7
@@ 1,6 1,6 @@ 
-'From Haver 6.0 [latest update: #5213] on 6 June 2022 at 10:20:23 pm'!
+'From Haver 6.0 [latest update: #5235] on 15 June 2022 at 10:35:35 am'!
 'Description I provide a grid-layout morph.'!
-!provides: 'GridLayout' 1 10!
+!provides: 'GridLayout' 1 11!
 !requires: 'Cuis-Base' 60 5213 nil!
 SystemOrganization addCategory: 'GridLayout'!
 

          
@@ 10,8 10,8 @@ Modules newEnvironment: #GridLayout!
 
 !interfacesOf: GridLayout!
 Modules environment: #GridLayout ::
+	interface: #SPI exporting: #(#CellMorph #GridLayoutWithHeadingsMorph #GridLayoutMorph ) ::
 	interface: #API exporting: #(#GridLayoutWithHeadingsMorph #GridLayoutMorph ) ::
-	interface: #SPI exporting: #(#GridLayoutWithHeadingsMorph #CellMorph #GridLayoutMorph ) ::
 	interface: #UTI exporting: #(#CellMorph #GridLayoutMorph )!
 
 

          
@@ 241,12 241,12 @@ initialize
 	super initialize.
 	self tryCreateSubMorphs! !
 
-!(Modules>>#GridLayout>>#GridLayoutMorph) methodsFor: 'layout' stamp: 'KLG 6/14/2021 22:06:12'!
+!(Modules>>#GridLayout>>#GridLayoutMorph) methodsFor: 'layout' stamp: 'KLG 6/15/2022 09:47:03'!
 computeColumnStarts
 	"Compute the y positions each column starts.."
 
 	| current |
-	current _ self separationWidth >> 1.
+	current _ self insetWidth.
 	^ columnWidths collect: [ :width | | last |
 		last _ current.
 		current _ width + current + self separationWidth.

          
@@ 276,17 276,27 @@ computeRowHeights
 		rowHeights at: rowNumber put: rowHeight ]
 						! !
 
-!(Modules>>#GridLayout>>#GridLayoutMorph) methodsFor: 'layout' stamp: 'KLG 6/14/2021 22:06:25'!
+!(Modules>>#GridLayout>>#GridLayoutMorph) methodsFor: 'layout' stamp: 'KLG 6/15/2022 09:47:38'!
 computeRowStarts
 	"Compute the x positions each row starts.."
 
 	| current |
-	current _ self separationHeight >> 2.
+	current _ self insetHeight.
 	^ rowHeights collect: [ :height | | last |
 		last _ current.
 		current _ height + current + self separationHeight.
 		last ]! !
 
+!(Modules>>#GridLayout>>#GridLayoutMorph) methodsFor: 'layout' stamp: 'KLG 6/15/2022 09:47:46'!
+insetHeight
+
+	^ self separationHeight >> 1! !
+
+!(Modules>>#GridLayout>>#GridLayoutMorph) methodsFor: 'layout' stamp: 'KLG 6/15/2022 09:47:03'!
+insetWidth
+
+	^ self separationWidth >> 1! !
+
 !(Modules>>#GridLayout>>#GridLayoutMorph) methodsFor: 'layout' stamp: 'KLG 6/15/2021 13:24:19'!
 layoutSubmorphs
 	"Compute a new layout based on the given layout bounds."