Skip to content

Commit

Permalink
fix the adjustment, use homogeneous row for the time being
Browse files Browse the repository at this point in the history
Fixes #1654
  • Loading branch information
estebanlm committed Nov 18, 2024
1 parent 7f72d39 commit ecb2bc4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ SpMorphicListViewAdapter >> newDataSource [
SpMorphicListViewAdapter >> newTableWith: datasource [

^ SpFTTableMorph new
beRowNotHomogeneous;
disableFunction;
dataSource: datasource;
hideColumnHeaders;
Expand Down
12 changes: 2 additions & 10 deletions src/Spec2-Adapters-Morphic/SpAbstractMorphicListAdapter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,15 @@ SpAbstractMorphicListAdapter >> addKeyBindingsTo: aWidget [
self addActivationKeyBindings: aWidget
]

{ #category : 'scrolling' }
SpAbstractMorphicListAdapter >> adjustDesiredVisibleRow: aNumber [

^ aNumber + (self hasHeaderTitle
ifTrue: [ 0 ]
ifFalse: [ 1 ])
]

{ #category : 'scrolling' }
SpAbstractMorphicListAdapter >> configureScrolling [
| vAlignment |

vAlignment := self presenter verticalAlignment.
vAlignment whenChangedDo: [
widget scrollToIndex: (self adjustDesiredVisibleRow: vAlignment desiredVisibleRow) ].
widget scrollToIndex: vAlignment desiredVisibleRow ].
self presenter whenDisplayDo: [
widget scrollToIndex: (self adjustDesiredVisibleRow: vAlignment desiredVisibleRow).
widget scrollToIndex: vAlignment desiredVisibleRow.
self scrollingChanged ].

widget
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Adapters-Morphic/SpMorphicListAdapter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ SpMorphicListAdapter >> refreshList [
{ #category : 'widget API' }
SpMorphicListAdapter >> refreshWidgetHeaderTitle [

self presenter hasHeaderTitle
self hasHeaderTitle
ifTrue: [
self widget columns first model title: self presenter headerTitle.
self widget
Expand Down
6 changes: 2 additions & 4 deletions src/Spec2-Backend-Tests/SpListCommonPropertiestTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ SpListCommonPropertiestTest >> testScrollDownToNonExistingIndexScrollsBottomToLa

{ #category : 'tests - scrolling' }
SpListCommonPropertiestTest >> testScrollDownToPosteriorIndexScrollsBottomToIndex [
self flag: #pharo7.
SystemVersion current major < 8 ifTrue: [ self skip. "Feature not supported in Pharo 7" ].

presenter items: (1 to: 500).
presenter verticalAlignment desiredVisibleRow: 100.

Expand All @@ -82,8 +81,7 @@ SpListCommonPropertiestTest >> testScrollUpToNegativeIndexScrollsTopToFirstIndex

{ #category : 'tests - scrolling' }
SpListCommonPropertiestTest >> testScrollUpToPreviousIndexScrollsTopToIndex [
self flag: #pharo7.
SystemVersion current major < 8 ifTrue: [ self skip. "Feature not supported in Pharo 7" ].

presenter items: (1 to: 500).
presenter verticalAlignment desiredVisibleRow: 100.
self openInstance.
Expand Down

0 comments on commit ecb2bc4

Please sign in to comment.