diff --git a/src/Bloc-Layout/BlGridLayoutImpl.class.st b/src/Bloc-Layout/BlGridLayoutImpl.class.st index 2b3945b81..df7c6a44c 100644 --- a/src/Bloc-Layout/BlGridLayoutImpl.class.st +++ b/src/Bloc-Layout/BlGridLayoutImpl.class.st @@ -187,10 +187,10 @@ BlGridLayoutImpl >> layout: anElement in: aRectangle context: aBlElementBoundsUp targetWidth := aRectangle width. targetHeight := aRectangle height. - paddingLeft := anElement insets left. - paddingRight := anElement insets right. - paddingTop := anElement insets top. - paddingBottom := anElement insets bottom. + paddingLeft := anElement padding left. + paddingRight := anElement padding right. + paddingTop := anElement padding top. + paddingBottom := anElement padding bottom. horizontalAxis applyLayoutWithin: targetWidth - paddingLeft - paddingRight. verticalAxis applyLayoutWithin: targetHeight - paddingTop - paddingBottom. @@ -274,8 +274,8 @@ BlGridLayoutImpl >> measure: anElement with: anExtentSpec [ self checkConsistency: anElement. self invalidateValues. - hPadding := anElement insets width. - vPadding := anElement insets height. + hPadding := anElement padding width. + vPadding := anElement padding height. widthSpecSansPadding := self adjust: widthSpec by: hPadding negated. heightSpecSansPadding := self adjust: heightSpec by: vPadding negated. diff --git a/src/Bloc-Layout/BlLinearLayoutHorizontalOrientation.class.st b/src/Bloc-Layout/BlLinearLayoutHorizontalOrientation.class.st index ffb6bed6f..c44d7e1fc 100644 --- a/src/Bloc-Layout/BlLinearLayoutHorizontalOrientation.class.st +++ b/src/Bloc-Layout/BlLinearLayoutHorizontalOrientation.class.st @@ -49,8 +49,8 @@ BlLinearLayoutHorizontalOrientation >> layout: anElement in: aRectangle context: "Layout subnodes vertically in column one by one based on previousely measured extent" - top := anElement insets top. - left := anElement insets left. + top := anElement padding top. + left := anElement padding left. right := left. bottom := top. @@ -59,8 +59,8 @@ BlLinearLayoutHorizontalOrientation >> layout: anElement in: aRectangle context: self layout direction with: theLayeredChildren do: [ :child | - right := right + child measuredWidth + (child outsets width max: 0.0). - bottom := bottom max: child measuredHeight + (child outsets height max: 0.0) ]. + right := right + child measuredWidth + (child margin width max: 0.0). + bottom := bottom max: child measuredHeight + (child margin height max: 0.0) ]. majorBounds := (left@top corner: right@bottom). elementInnerBounds := anElement padding inset: anElement boundsInLocal. @@ -81,8 +81,8 @@ BlLinearLayoutHorizontalOrientation >> layout: anElement in: aRectangle context: into: [ :origin :child | | childBounds childMarginBounds childConstraints interspacing | childConstraints := child constraints linear. - childBounds := origin + (child outsets topLeft max: 0.0@0.0) extent: child measuredExtent. - childMarginBounds := origin extent: child measuredExtent + (child outsets extent max: 0.0@0.0). + childBounds := origin + (child margin topLeft max: 0.0@0.0) extent: child measuredExtent. + childMarginBounds := origin extent: child measuredExtent + (child margin extent max: 0.0@0.0). self layout verticalAlignment ifNotNull: [ | translation allowedBounds | @@ -108,7 +108,7 @@ BlLinearLayoutHorizontalOrientation >> layout: anElement in: aRectangle context: child applyLayoutIn: childBounds context: aBlElementBoundsUpdateContext. "translating origin horizontally right for next subnode" turn := turn + 1. - (origin x + child measuredWidth + (child outsets width max: 0.0) + self layout cellSpacing) @ origin y ] + (origin x + child measuredWidth + (child margin width max: 0.0) + self layout cellSpacing) @ origin y ] ] { #category : #orientation } @@ -133,12 +133,14 @@ BlLinearLayoutHorizontalOrientation >> lengthSpec: anExtentSpec [ { #category : #orientation } BlLinearLayoutHorizontalOrientation >> marginBreadth: anElement [ - ^ anElement outsets height + + ^ anElement margin height ] { #category : #orientation } BlLinearLayoutHorizontalOrientation >> marginLength: anElement [ - ^ anElement outsets width + + ^ anElement margin width ] { #category : #orientation } @@ -172,10 +174,12 @@ BlLinearLayoutHorizontalOrientation >> minimalLength: anElement [ { #category : #orientation } BlLinearLayoutHorizontalOrientation >> paddingBreadth: anElement [ - ^ anElement insets height + + ^ anElement padding height ] { #category : #orientation } BlLinearLayoutHorizontalOrientation >> paddingLength: anElement [ - ^ anElement insets width + + ^ anElement padding width ] diff --git a/src/Bloc-Layout/BlLinearLayoutVerticalOrientation.class.st b/src/Bloc-Layout/BlLinearLayoutVerticalOrientation.class.st index 23f3a507d..9e2146d23 100644 --- a/src/Bloc-Layout/BlLinearLayoutVerticalOrientation.class.st +++ b/src/Bloc-Layout/BlLinearLayoutVerticalOrientation.class.st @@ -49,8 +49,8 @@ BlLinearLayoutVerticalOrientation >> layout: anElement in: aRectangle context: a "Layout subnodes vertically in column one by one based on previously measured extent" - top := anElement insets top. - left := anElement insets left. + top := anElement padding top. + left := anElement padding left. right := left. bottom := top. @@ -59,8 +59,8 @@ BlLinearLayoutVerticalOrientation >> layout: anElement in: aRectangle context: a self layout direction with: theLayeredChildren do: [ :child | - right := right max: child measuredWidth + (child outsets width max: 0.0). - bottom := bottom + child measuredHeight + (child outsets height max: 0.0) ]. + right := right max: child measuredWidth + (child margin width max: 0.0). + bottom := bottom + child measuredHeight + (child margin height max: 0.0) ]. majorBounds := (left@top corner: right@bottom). elementInnerBounds := anElement padding inset: anElement boundsInLocal. @@ -81,8 +81,8 @@ BlLinearLayoutVerticalOrientation >> layout: anElement in: aRectangle context: a into: [ :origin :child | | childBounds childMarginBounds childConstraints interspacing | childConstraints := child constraints linear. - childBounds := origin + (child outsets topLeft max: 0.0@0.0) extent: child measuredExtent. - childMarginBounds := origin extent: child measuredExtent + (child outsets extent max: 0.0@0.0). + childBounds := origin + (child margin topLeft max: 0.0@0.0) extent: child measuredExtent. + childMarginBounds := origin extent: child measuredExtent + (child margin extent max: 0.0@0.0). self layout horizontalAlignment ifNotNull: [ | translation allowedBounds | @@ -109,7 +109,7 @@ BlLinearLayoutVerticalOrientation >> layout: anElement in: aRectangle context: a child applyLayoutIn: childBounds context: aBlElementBoundsUpdateContext. "translating origin vertically down for next subnode" turn := turn + 1. - origin x @(origin y + child measuredHeight + self layout cellSpacing + (child outsets height max: 0.0)) ] + origin x @(origin y + child measuredHeight + self layout cellSpacing + (child margin height max: 0.0)) ] ] { #category : #orientation } @@ -134,12 +134,14 @@ BlLinearLayoutVerticalOrientation >> lengthSpec: anExtentSpec [ { #category : #orientation } BlLinearLayoutVerticalOrientation >> marginBreadth: anElement [ - ^ anElement outsets width + + ^ anElement margin width ] { #category : #orientation } BlLinearLayoutVerticalOrientation >> marginLength: anElement [ - ^ anElement outsets height + + ^ anElement margin height ] { #category : #orientation } @@ -173,10 +175,12 @@ BlLinearLayoutVerticalOrientation >> minimalLength: anElement [ { #category : #orientation } BlLinearLayoutVerticalOrientation >> paddingBreadth: anElement [ - ^ anElement insets width + + ^ anElement padding width ] { #category : #orientation } BlLinearLayoutVerticalOrientation >> paddingLength: anElement [ - ^ anElement insets height + + ^ anElement padding height ] diff --git a/src/Bloc/BlElement.class.st b/src/Bloc/BlElement.class.st index 2a276bb99..9f7c5f494 100644 --- a/src/Bloc/BlElement.class.st +++ b/src/Bloc/BlElement.class.st @@ -1987,6 +1987,11 @@ BlElement >> initializeEventDispatcher [ { #category : #'geometry bounds' } BlElement >> insets [ + + self + deprecated: 'Use #padding instead of current one' + transformWith: '`@receiver insets' -> '`@receiver padding'. + ^ self padding ] @@ -2994,6 +2999,11 @@ BlElement >> openInSpace [ { #category : #'geometry bounds' } BlElement >> outsets [ + + self + deprecated: 'Use #margin instead of current one' + transformWith: '`@receiver outsets' -> '`@receiver margin'. + ^ self margin ] diff --git a/src/Bloc/BlLayout.class.st b/src/Bloc/BlLayout.class.st index 56e15066e..2e8b83647 100644 --- a/src/Bloc/BlLayout.class.st +++ b/src/Bloc/BlLayout.class.st @@ -288,8 +288,8 @@ BlLayout >> measureChildWithMargins: anElement parentSpec: parentSpec widthUsed: self measureChild: anElement parentSpec: parentSpec - widthUsed: anElement parent insets width + anElement outsets width + widthUsed - heightUsed: anElement parent insets height + anElement outsets height + heightUsed + widthUsed: anElement parent padding width + anElement margin width + widthUsed + heightUsed: anElement parent padding height + anElement margin height + heightUsed ] { #category : #'private - measurement' }