Skip to content

Commit

Permalink
Merge pull request #1265 from demarey/table-alternate-row-colors
Browse files Browse the repository at this point in the history
Let the presenter configure  alternated raw colors at any time.
  • Loading branch information
estebanlm authored Mar 25, 2022
2 parents 17a4f79 + 982aab4 commit a49e12c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
12 changes: 1 addition & 11 deletions src/Spec2-Adapters-Morphic/SpMorphicTableAdapter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ Is important notice here that most of the row/cell creation happens on SpMorphic
Class {
#name : #SpMorphicTableAdapter,
#superclass : #SpAbstractMorphicListAdapter,
#instVars : [
'alternateRowColors'
],
#category : #'Spec2-Adapters-Morphic-Table'
}

Expand Down Expand Up @@ -71,7 +68,7 @@ SpMorphicTableAdapter >> addModelTo: tableMorph [

{ #category : #configuring }
SpMorphicTableAdapter >> alternateRowsColor [
alternateRowColors := true.
self widgetDo: [ :w | w alternateRowsColor: true ]
]

{ #category : #factory }
Expand All @@ -83,7 +80,6 @@ SpMorphicTableAdapter >> buildWidget [
intercellSpacing: self class intercellSpacing;
dragEnabled: self dragEnabled;
dropEnabled: self dropEnabled;
alternateRowsColor: alternateRowColors;
yourself.

self addModelTo: widget.
Expand Down Expand Up @@ -125,12 +121,6 @@ SpMorphicTableAdapter >> ifSorted: sortedBlock ifNotSorted: notSortedBlock [
^ notSortedBlock value
]

{ #category : #initialization }
SpMorphicTableAdapter >> initialize [
super initialize.
alternateRowColors := false.
]

{ #category : #testing }
SpMorphicTableAdapter >> isNonEditableRow: aRow column: aColumn [

Expand Down
13 changes: 0 additions & 13 deletions src/Spec2-Tests/SpTablePresenterTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,6 @@ SpTablePresenterTest >> testAddColumnRaisesOneEventOnly [
self assert: count equals: 1
]

{ #category : #tests }
SpTablePresenterTest >> testCanAlternateRowColors [

presenter
hideColumnHeaders;
alternateRowsColor.

self openInstance.

presenter withAdapterPerformOrDefer: [ :adapter |
self assert: (adapter instVarNamed: #alternateRowColors) equals: true ]
]

{ #category : #tests }
SpTablePresenterTest >> testGivenSortingIsActiveWhenAffectingNewItemsThenNewItemsAreSorted [

Expand Down

0 comments on commit a49e12c

Please sign in to comment.