Skip to content

Commit 7792925

Browse files
authored
Merge pull request #1843 from koendehondt/gh-1830
Fix missing paginator in the inspector
2 parents eab4d7c + 12b99d2 commit 7792925

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

src/Spec2-Adapters-Morphic/SpMorphicBoxAdapter.class.st

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ SpMorphicBoxAdapter >> addConstraints: constraints toChild: childMorph [
5454
ifFalse: [
5555
"Set morph to stay rigid"
5656
layout direction setRigidityOfNonExpandedMorph: theMorph.
57-
constraints width ifNotNil: [ :w | theMorph width: w ].
58-
constraints height ifNotNil: [ :h | theMorph height: h ] ].
57+
constraints width ifNotNil: [ :w | self setFixedWidth: w toMorph: theMorph].
58+
constraints height ifNotNil: [ :h | self setFixedHeight: h toMorph: theMorph ] ].
5959

6060
^ theMorph
6161
]
@@ -169,6 +169,17 @@ SpMorphicBoxAdapter >> childrenWidgets [
169169
^ self children
170170
]
171171

172+
{ #category : 'private' }
173+
SpMorphicBoxAdapter >> hasFixedSize: aPanel [
174+
175+
| props minCellSize |
176+
props := aPanel layoutProperties.
177+
props ifNil: [ ^ false ].
178+
minCellSize := props minCellSize.
179+
minCellSize ifNil: [ ^ false ].
180+
^ minCellSize = props maxCellSize
181+
]
182+
172183
{ #category : 'factory' }
173184
SpMorphicBoxAdapter >> layout: aLayout [
174185

@@ -307,6 +318,24 @@ SpMorphicBoxAdapter >> replace: aPresenter with: otherPresenter withConstraints:
307318
panel replaceSubmorph: oldMorph by: newMorph
308319
]
309320

321+
{ #category : 'private' }
322+
SpMorphicBoxAdapter >> setFixedHeight: aNumber toMorph: aMorph [
323+
324+
aMorph
325+
minCellSize: aNumber;
326+
maxCellSize: aNumber;
327+
height: aNumber
328+
]
329+
330+
{ #category : 'private' }
331+
SpMorphicBoxAdapter >> setFixedWidth: aNumber toMorph: aMorph [
332+
333+
aMorph
334+
minCellSize: aNumber;
335+
maxCellSize: aNumber;
336+
width: aNumber
337+
]
338+
310339
{ #category : 'updating' }
311340
SpMorphicBoxAdapter >> updateSpacing [
312341

@@ -347,10 +376,10 @@ SpMorphicBoxAdapter >> verifyBoxExtentOf: aPanel withChild: childMorph [
347376
ifTrue: [ height := height + aPanel height + spacing ]
348377
ifFalse: [ width := width + aPanel width + spacing ].
349378

350-
newPanelWidth := aPanel hResizing = #rigid
379+
newPanelWidth := (layout isHorizontal and: [ self hasFixedSize: aPanel ])
351380
ifTrue: [ aPanel width ]
352381
ifFalse: [ aPanel width max: width ].
353-
newPanelHeight := aPanel vResizing = #rigid
382+
newPanelHeight := (layout isVertical and: [ self hasFixedSize: aPanel ])
354383
ifTrue: [ aPanel height ]
355384
ifFalse: [ aPanel height max: height ].
356385
aPanel extent: newPanelWidth @ newPanelHeight

0 commit comments

Comments
 (0)