Skip to content

Commit 1497b64

Browse files
committed
fixes anchored window closing (now use the BlElementToBeremovedFromParentEvent event).
1 parent 77e28fa commit 1497b64

12 files changed

+46
-32
lines changed

src/Toplo-Examples/ToSandBox.class.st

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,6 +2101,10 @@ ToSandBox class >> example_CircularMenuPane [
21012101
item icon: (iconProvider iconNamed: #outlined_sms).
21022102
circularMenu addItem: item.
21032103

2104+
item := ToToggleMenuItem new labelText: 'Toggle'.
2105+
item clickAction: [:evt | evt traceCr ].
2106+
circularMenu addItem: item.
2107+
21042108
item := ToMenuItem new labelText: 'Inspect'.
21052109
" item constraints annulus sectorAngleWeight: 0.20."
21062110
item clickAction: [ space inspect ].

src/Toplo-Tests/ToAnchoredWindowManagerTest.class.st

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ ToAnchoredWindowManagerTest >> testElementPositionInSpaceChangedEvent [
186186
]
187187

188188
{ #category : #tests }
189-
ToAnchoredWindowManagerTest >> testElementRemovedFromParentEvent [
189+
ToAnchoredWindowManagerTest >> testElementToBeRemovedFromParentEvent [
190190

191191
| win e windowManager closed |
192192
e := ToElement new.
@@ -212,12 +212,6 @@ ToAnchoredWindowManagerTest >> testElementRemovedFromParentEvent [
212212
self assert: windowManager currentWindow isNil
213213
]
214214

215-
{ #category : #tests }
216-
ToAnchoredWindowManagerTest >> testElementRemovedFromSceneGraphEvent [
217-
218-
self testElementRemovedFromParentEvent
219-
]
220-
221215
{ #category : #tests }
222216
ToAnchoredWindowManagerTest >> testHasWindow [
223217

src/Toplo-Widget-Accordion/ToAccordionElement.class.st

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ ToAccordionElement >> newBody [
124124
^ ToAccordionBodyElement new
125125
]
126126

127+
{ #category : #'t - element with action' }
128+
ToAccordionElement >> newClickAction: aValuable [
129+
130+
^ self newCheckAction: aValuable
131+
]
132+
127133
{ #category : #'instance creation' }
128134
ToAccordionElement >> newHeader [
129135

src/Toplo-Widget-Button/ToGeneralButtonSkin.class.st

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ ToGeneralButtonSkin >> installSkinEvent: anEvent [
5555

5656
super installSkinEvent: anEvent.
5757
anEvent elementDo: [ :e |
58-
e mouseCursor: Cursor normal.
5958
e isSegmentedItem ifTrue: [
6059
(e isKindOf: ToCheckbox) ifTrue: [
6160
e

src/Toplo-Widget-Button/ToToggleButton.class.st

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ ToToggleButton >> initialize [
1818
self clickEventClass: ToCheckableChangedEvent
1919
]
2020

21+
{ #category : #'t - element with action' }
22+
ToToggleButton >> newClickAction: aValuable [
23+
24+
^ self newCheckAction: aValuable
25+
]
26+
2127
{ #category : #skin }
2228
ToToggleButton >> newRawSkin [
2329

src/Toplo-Widget-List/TToInnerFiniteListElement.trait.st

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ TToInnerFiniteListElement >> innerElement [
126126
^ self
127127
]
128128

129+
{ #category : #accessing }
130+
TToInnerFiniteListElement >> layoutPositionsRange [
131+
132+
^ 1 to: self nodeContainers size
133+
]
134+
129135
{ #category : #'t - inner finite list element - initialization' }
130136
TToInnerFiniteListElement >> newNodeHolderFromDataSource: aDataSource [
131137

src/Toplo-Widget-List/ToListDataSourceActionCommand.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ToListDataSourceActionCommand >> action: aValuable [
2828
{ #category : #application }
2929
ToListDataSourceActionCommand >> applyIn: anInfiniteElement [
3030

31-
action value
31+
action cull: anInfiniteElement listElement
3232
]
3333

3434
{ #category : #'infinite compatibility' }

src/Toplo-Widget-List/ToListDisabledSelectionElementEventHandler.class.st

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ ToListDisabledSelectionElementEventHandler >> listDisabledSelectionChangedEvent:
1919
anEvent selectionModel selectedIndexesIntervalsDo: [ :int |
2020
listElement selectionMode makeDisabledUnselectable ifTrue: [
2121
listElement selecter deselectInterval: int ] ].
22-
anEvent appliedCommand indexes do: [ :idx |
23-
listElement dataSource notifyItemsChanged: (idx to: idx) ].
24-
listElement requestUpdateSelectionMode:
25-
listElement primarySelectionMode
22+
23+
listElement postponeAction: [
24+
anEvent appliedCommand indexes do: [ :idx |
25+
(listElement layoutPositionsRange includes: idx) ifTrue: [
26+
listElement dataSource notifyItemsChanged: (idx to: idx) ] ].
27+
listElement requestUpdateSelectionMode:
28+
listElement primarySelectionMode ]
2629
]

src/Toplo-Widget-Menu/ToMenuItemElementSkin.class.st

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ ToMenuItemElementSkin >> installSkinEvent: anEvent [
2525

2626
super installSkinEvent: anEvent.
2727
anEvent elementDo: [ :e |
28-
e mouseCursor: Cursor normal.
2928
e geometry: (BlRoundedRectangleGeometry cornerRadius:
3029
(e valueOfTokenNamed: 'border-radius')) ]
3130
]

src/Toplo-Widget-Menu/ToToggleMenuItem.class.st

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ I'm one of the leave of menu composite.
55
Class {
66
#name : #ToToggleMenuItem,
77
#superclass : #ToMenuItem,
8-
#traits : 'TToCheckable',
9-
#classTraits : 'TToCheckable classTrait',
108
#category : #'Toplo-Widget-Menu-Items'
119
}
1210

@@ -18,6 +16,12 @@ ToToggleMenuItem >> initialize [
1816
self initializeAsCheckable
1917
]
2018

19+
{ #category : #'t - element with action' }
20+
ToToggleMenuItem >> newClickAction: aValuable [
21+
22+
^ self newCheckAction: aValuable
23+
]
24+
2125
{ #category : #skin }
2226
ToToggleMenuItem >> newRawSkin [
2327

0 commit comments

Comments
 (0)