Skip to content

Commit

Permalink
Fix buttons serialization and remove tooltips TU
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyan11 committed Sep 27, 2024
1 parent 08efb97 commit 1ce760b
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 95 deletions.
4 changes: 2 additions & 2 deletions src/Toplo-Serialization-STON/ToButton.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ ToButton >> stonUserDataOn: aIdentityDictionary [
super stonUserDataOn: aIdentityDictionary.

"LabeledIcon"
(self class usesTrait: TToElementWithLabeledIcon) ifTrue: [
aIdentityDictionary at: #stonLabeledIcon put: self labeledIcon ].
"(self class usesTrait: TToLabeledIcon) ifTrue: [
aIdentityDictionary at: #stonLabeledIcon put: self labeledIcon ]."

"Checkable"
self isCheckable ifFalse: [ ^ self ].
Expand Down
8 changes: 8 additions & 0 deletions src/Toplo-Serialization-Stash/BlElement.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ BlElement >> allSetterAndGettersForMyStashAllTokens [


]

{ #category : #'*Toplo-Serialization-Stash' }
BlElement >> stashEnabled [

<stashAccessors>
self isEnabled ifTrue: [ ^ { } ].
^ { (#enabled: -> #isEnabled) }
]
8 changes: 5 additions & 3 deletions src/Toplo-Serialization-Stash/TToCheckable.extension.st
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
Extension { #name : #TToCheckable }

{ #category : #'*Toplo-Serialization-Stash' }
TToCheckable >> allSetterAndGettersOfTraitForMyStash: aToElement [
TToCheckable >> stashAccessorsForTToCheckable [

<stashAccessors>
| settersAndGetters |
self isCheckable ifFalse: [ ^ { } ].
settersAndGetters := OrderedCollection new.
settersAndGetters add: #checked.
settersAndGetters add: #group.
settersAndGetters add: #initializeCheckable onlySetOnStash.
self checked ifTrue: [ settersAndGetters add: #checked ].
self group ifNotNil: [ settersAndGetters add: #group ].
^ settersAndGetters
]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
Extension { #name : #TToElementWithTooltip }

{ #category : #'*Toplo-Serialization-Stash' }
TToElementWithTooltip >> allSetterAndGettersOfTraitForMyStash: aToElement [
TToElementWithTooltip >> stashAccessorsForTToElementWithTooltip [

<stashAccessors>

self hasTooltip ifFalse: [ ^ { } ].
^ { #tooltipBuilder. #closeTooltipWindowOnMouseLeave . #tooltipPopupDelay }
^ { #tooltipBuilder. #closeTooltipWindowOnMouseLeave.
#tooltipPopupDelay }
]
8 changes: 0 additions & 8 deletions src/Toplo-Serialization-Stash/TToEnableable.extension.st

This file was deleted.

28 changes: 28 additions & 0 deletions src/Toplo-Serialization-Stash/TToTripletElement.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Extension { #name : #TToTripletElement }

{ #category : #'*Toplo-Serialization-Stash' }
TToTripletElement >> stashAccessorsForTToTripletElement [

<stashAccessors>

| settersAndGetters |
settersAndGetters := OrderedCollection new.

self endAlignment ifNotNil: [ settersAndGetters add: #endAlignment ].
self endElement ifNotNil: [ settersAndGetters add: #endElement ].
self endFlexible ifTrue: [ settersAndGetters add: #endFlexible ].
self endInterspace = 0 ifFalse: [
settersAndGetters add: #endInterspace ].

self flexible ifTrue: [ settersAndGetters add: #flexible ].
self middleElement ifNotNil: [ settersAndGetters add: #middleElement ].

self startAlignment ifNotNil: [
settersAndGetters add: #startAlignment ].
self startElement ifNotNil: [ settersAndGetters add: #startElement ].
self startFlexible ifTrue: [ settersAndGetters add: #startFlexible ].
self startInterspace = 0 ifFalse: [
settersAndGetters add: #startInterspace ].

^ settersAndGetters
]
9 changes: 0 additions & 9 deletions src/Toplo-Serialization-Stash/ToButton.extension.st

This file was deleted.

39 changes: 0 additions & 39 deletions src/Toplo-Serialization-Tests/ToSerializerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -368,42 +368,3 @@ ToSerializerTest >> testTokens [
self assert: (element valueOfTokenNamed: #hello) value equals: #goodbye.
self assert: (element valueOfTokenNamed: #titi) value equals: #toto ]
]

{ #category : #tests }
ToSerializerTest >> testTooltip1 [

| origin |
origin := ToElement new.

self
test: origin
on: [ :element | self assert: element hasTooltip equals: false ]
]

{ #category : #tests }
ToSerializerTest >> testTooltip2 [

| origin |
origin := ToElement new
tooltipText: 'hello tooltip';
closeTooltipWindowOnMouseLeave: false;
yourself.

self test: origin on: [ :element |
self assert: element hasTooltip.
self deny: element closeTooltipWindowOnMouseLeave. ]
]

{ #category : #tests }
ToSerializerTest >> testTooltip3 [

| origin |
origin := ToElement new
tooltipText: 'hello tooltip';
tooltipPopupDelay: 5;
yourself.

self test: origin on: [ :element |
self assert: element hasTooltip.
self assert: element tooltipPopupDelay equals: 5 ]
]

This file was deleted.

7 changes: 7 additions & 0 deletions src/Toplo-Serialization/ToPane.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : #ToPane }

{ #category : #'*Toplo-Serialization' }
ToPane >> shouldSerializedChildren [

^ self class == ToPane
]

0 comments on commit 1ce760b

Please sign in to comment.