Skip to content

Commit

Permalink
remove ToInnerElementRemovedEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
plantec committed Nov 4, 2024
1 parent b45e2e3 commit f5074b7
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 27 deletions.
1 change: 1 addition & 0 deletions src/Toplo-Examples/ToSandBox.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2587,6 +2587,7 @@ ToSandBox class >> example_TabBar [

| tb |
tb := ToTabBarElement new.
tb withCloseButton: true.
tb nodeWrapping: false.
tb dataAccessor addAll: ((ToSandBox statesOfAmerica collect: [ :s |
ToSingleTagModel new data: s ]) copyFrom: 1 to: 8).
Expand Down
11 changes: 0 additions & 11 deletions src/Toplo-Widget-Menu/ToMenuBarEventFilter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,6 @@ ToMenuBarEventFilter >> mouseOverEvent: anEvent [
ifFalse: [ m closeWindow ] ]
]

{ #category : #'as yet unclassified' }
ToMenuBarEventFilter >> mouseUpOutsideEvent: anEvent [

target autoOpen ifFalse: [ ^ self ].
anEvent originalEvent target ifNil: [ ^ self ].
(anEvent originalEvent target hasInParentChain: target)
ifTrue: [ ^ self ].
anEvent consume.
target autoOpen: false
]

{ #category : #'api - hooks' }
ToMenuBarEventFilter >> onInstalledIn: anElement [

Expand Down
1 change: 0 additions & 1 deletion src/Toplo-Widget-Tag/TToTagElement.trait.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ TToTagElement >> addRemoveButton [
but icon: (ToImage inner: (self iconNamed: #windowClose)).
but constraintsDo: [ :c | c linear vertical alignCenter ].
but whenClickedDo: [ :event |
self fireEvent: ToInnerElementRemovedEvent new.
self removeFromParent ].
but id: #removeButton.
self addChild: but after: self endContainer
Expand Down
9 changes: 0 additions & 9 deletions src/Toplo-Widget-Tag/ToPickedTagModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@ Class {
#category : #'Toplo-Widget-Tag-Bar'
}

{ #category : #'node building' }
ToPickedTagModel >> buildNode: aNode inHolder: aNodeHolder withManager: aNodeManager [

super buildNode: aNode inHolder: aNodeHolder withManager: aNodeManager.
aNode addEventHandlerOn: ToInnerElementRemovedEvent do: [ :event |
event consume.
aNode removeFromBar ]
]

{ #category : #accessing }
ToPickedTagModel >> pickOrder [

Expand Down
11 changes: 10 additions & 1 deletion src/Toplo-Widget-Tag/ToTagBarElement.class.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Class {
#name : #ToTagBarElement,
#superclass : #ToBarElement,
#instVars : [
'withCloseButton'
],
#category : #'Toplo-Widget-Tag-Bar'
}

Expand Down Expand Up @@ -78,5 +81,11 @@ ToTagBarElement >> sample: aData [
{ #category : #accessing }
ToTagBarElement >> withCloseButton [

^ false
^ withCloseButton ifNil: [ withCloseButton := false ]
]

{ #category : #accessing }
ToTagBarElement >> withCloseButton: aBoolean [

withCloseButton := aBoolean
]
4 changes: 4 additions & 0 deletions src/Toplo-Widget-Tag/ToTagNodeHolder.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ Class {

{ #category : #removing }
ToTagNodeHolder >> removeNodeFromBar [
"
since a select node is created by selecting and item in the list element,
removing the node is done by deselecting the corresponding list item in the select popu list "

self dataSource removeAt: self position
]

{ #category : #accessing }
Expand Down
4 changes: 4 additions & 0 deletions src/Toplo-Widget-Tag/ToTagNodeManager.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ ToTagNodeManager >> defaultNodeBuilder [
hMatchParent.
tag removable: holder withCloseButton.
node addChild: tag.
tag removeButton ifNotNil: [ :btn |
tag
addEventHandlerOn: BlElementRemovedFromParentEvent
do: [ node removeFromBar ] ].
tag constraintsDo: [ :c | c linear vertical alignCenter ] ]
]

Expand Down
5 changes: 0 additions & 5 deletions src/Toplo/ToInnerElementRemovedEvent.class.st

This file was deleted.

0 comments on commit f5074b7

Please sign in to comment.