Skip to content

Commit

Permalink
Merge pull request #129 from pharo-graphics/rmLayoutMonitor
Browse files Browse the repository at this point in the history
Remove layoutMonitor from ToInfiniteElement
  • Loading branch information
plantec authored Mar 27, 2024
2 parents 3e5f724 + 8257851 commit 208c07d
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions src/Toplo-Widget-List/ToInfiniteElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Class {
#traits : 'TBlLayoutResizable',
#classTraits : 'TBlLayoutResizable classTrait',
#instVars : [
'layoutMonitor',
'nodeHolderFactory',
'listElement'
],
Expand Down Expand Up @@ -52,12 +51,6 @@ ToInfiniteElement >> disableScrolledEvent [
self eventDispatcher disableScrolledEvent
]

{ #category : #layout }
ToInfiniteElement >> dispatchLayout [

self layoutCritical: [ super dispatchLayout ]
]

{ #category : #'scrolled event' }
ToInfiniteElement >> enableScrolledEvent [

Expand All @@ -74,14 +67,13 @@ ToInfiniteElement >> infinite [
ToInfiniteElement >> initialize [

super initialize.
layoutMonitor := Monitor new.
self matchParent
]

{ #category : #layout }
ToInfiniteElement >> layoutCritical: aBlock [

layoutMonitor critical: aBlock
aBlock value
]

{ #category : #accessing }
Expand Down Expand Up @@ -124,18 +116,17 @@ ToInfiniteElement >> nodeContainingGlobalPosition: aPoint [
ToInfiniteElement >> nodeGroupsSatisfying: aBlock [
" return an array of collection. Each collection contains a list of adjacent selected nodes "

self layoutCritical: [
^ Array streamContents: [ :stream |
| g |
g := OrderedCollection new.
self childrenDo: [ :node |
(aBlock value: node)
ifTrue: [ g add: node ]
ifFalse: [
g ifNotEmpty: [
stream nextPut: g.
g := OrderedCollection new ] ] ].
g ifNotEmpty: [ stream nextPut: g ] ] ]
^ Array streamContents: [ :stream |
| g |
g := OrderedCollection new.
self childrenDo: [ :node |
(aBlock value: node)
ifTrue: [ g add: node ]
ifFalse: [
g ifNotEmpty: [
stream nextPut: g.
g := OrderedCollection new ] ] ].
g ifNotEmpty: [ stream nextPut: g ] ]
]

{ #category : #'accessing - nodes' }
Expand Down

0 comments on commit 208c07d

Please sign in to comment.