Skip to content

Commit

Permalink
added a flag in ToToggleTrackElement delatToLeft and deltaToRight to …
Browse files Browse the repository at this point in the history
…point to my uggly code
  • Loading branch information
plantec committed Jul 24, 2023
1 parent 855a41e commit feea14b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/Toplo/ToToggleSwitchBarElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ ToToggleSwitchBarElement >> button [
{ #category : #accessing }
ToToggleSwitchBarElement >> button: anElement [

anElement ifNotNil: [
anElement constraintsDo: [ :c | c linear vertical alignCenter ] ].
anElement ifNotNil: [ anElement constraintsDo: [ :c | c linear vertical alignCenter ] ].
button := anElement.
self updateChildren
]
Expand Down
6 changes: 3 additions & 3 deletions src/Toplo/ToToggleTrackElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ Class {
{ #category : #sliding }
ToToggleTrackElement >> deltaToLeft [

self flag: 'Uggly computation...Please fix my implementation'.
^ self width - self deltaToRight - self switchButton width - self padding left - self padding right - self switchBar margin right
]

{ #category : #sliding }
ToToggleTrackElement >> deltaToRight [

^ self width - self switchButton position x - self switchButton width - self padding right - self padding left - self switchBar margin right


self flag: 'Uggly computation... Please fix my implementation'.
^ self requestedWidth - self switchButton position x - self switchButton requestedWidth - self padding right - self padding left - self switchBar margin right
]

{ #category : #initialization }
Expand Down

0 comments on commit feea14b

Please sign in to comment.