From 9e659df29096ff3701bf681c7c54cbeeda9b0680 Mon Sep 17 00:00:00 2001 From: Joana Bergsiek Date: Thu, 25 Jan 2024 16:31:50 +0100 Subject: [PATCH] Applying permutation does update and updates fixed in tab usage --- packages/Sandblocks-Babylonian/Morph.extension.st | 2 +- packages/Sandblocks-Babylonian/SBExampleCluster.class.st | 5 +++-- .../Sandblocks-Babylonian/SBPermutationLabel.class.st | 2 +- .../Sandblocks-Babylonian/SBPermutationLabel.extension.st | 2 +- packages/Sandblocks-Core/SBTabView.class.st | 8 ++++++++ packages/Sandblocks-Morphs/SBButton.class.st | 3 +-- packages/Sandblocks-Utils/SBPermutation.class.st | 3 +++ 7 files changed, 18 insertions(+), 7 deletions(-) diff --git a/packages/Sandblocks-Babylonian/Morph.extension.st b/packages/Sandblocks-Babylonian/Morph.extension.st index 6ff57393..4c9c06bf 100644 --- a/packages/Sandblocks-Babylonian/Morph.extension.st +++ b/packages/Sandblocks-Babylonian/Morph.extension.st @@ -7,7 +7,7 @@ Morph class >> exampleObject [ ] { #category : #'*Sandblocks-Babylonian' } -Morph >> listensToPermutations [ +Morph >> listensToPermutations [ ^ false ] diff --git a/packages/Sandblocks-Babylonian/SBExampleCluster.class.st b/packages/Sandblocks-Babylonian/SBExampleCluster.class.st index e1fc9273..c84dbaca 100644 --- a/packages/Sandblocks-Babylonian/SBExampleCluster.class.st +++ b/packages/Sandblocks-Babylonian/SBExampleCluster.class.st @@ -71,9 +71,10 @@ SBExampleCluster >> extractedTopHeadingsFrom: aSBMultiverse [ ^ (aSBMultiverse universes collect: [:aUniverse | self newContainerMorph + listDirection: #leftToRight; addAllMorphsBack: { - SBPermutationLabel newDisplaying: aUniverse activePermutation. - SBButton newApplyPermutationFor: aUniverse activePermutation}]) + SBButton newApplyPermutationFor: aUniverse activePermutation. + SBPermutationLabel newDisplaying: aUniverse activePermutation}]) ] { #category : #accessing } diff --git a/packages/Sandblocks-Babylonian/SBPermutationLabel.class.st b/packages/Sandblocks-Babylonian/SBPermutationLabel.class.st index d24ba0da..9738c059 100644 --- a/packages/Sandblocks-Babylonian/SBPermutationLabel.class.st +++ b/packages/Sandblocks-Babylonian/SBPermutationLabel.class.st @@ -17,7 +17,7 @@ SBPermutationLabel class >> newDisplaying: aSBPermutation [ ] { #category : #'*Sandblocks-Babylonian' } -SBPermutationLabel >> listensToPermutations [ +SBPermutationLabel >> listensToPermutations [ ^ true ] diff --git a/packages/Sandblocks-Babylonian/SBPermutationLabel.extension.st b/packages/Sandblocks-Babylonian/SBPermutationLabel.extension.st index 9dc34b5b..ad89430d 100644 --- a/packages/Sandblocks-Babylonian/SBPermutationLabel.extension.st +++ b/packages/Sandblocks-Babylonian/SBPermutationLabel.extension.st @@ -1,7 +1,7 @@ Extension { #name : #SBPermutationLabel } { #category : #'*Sandblocks-Babylonian' } -SBPermutationLabel >> listensToPermutations [ +SBPermutationLabel >> listensToPermutations [ ^ true ] diff --git a/packages/Sandblocks-Core/SBTabView.class.st b/packages/Sandblocks-Core/SBTabView.class.st index 68d361ed..932845ff 100644 --- a/packages/Sandblocks-Core/SBTabView.class.st +++ b/packages/Sandblocks-Core/SBTabView.class.st @@ -142,6 +142,14 @@ SBTabView >> addTab [ self add: (self active veryDeepCopy name: self activeName, '_i') ] +{ #category : #'submorphs - enumerating' } +SBTabView >> allMorphsDepthFirstDo: aBlock [ + + submorphs do: [:m | m allMorphsDepthFirstDo: aBlock]. + (self namedBlocks reject: [:m | m = self active]) do: [:m | m block allMorphsDepthFirstDo: aBlock]. + aBlock value: self +] + { #category : #ui } SBTabView >> asTabButton: aNamedBlock [ diff --git a/packages/Sandblocks-Morphs/SBButton.class.st b/packages/Sandblocks-Morphs/SBButton.class.st index b826b92a..bdad3f64 100644 --- a/packages/Sandblocks-Morphs/SBButton.class.st +++ b/packages/Sandblocks-Morphs/SBButton.class.st @@ -18,8 +18,7 @@ SBButton class >> newApplyPermutationFor: aPermutation [ size: 8.0 sbScaled; color: (Color r: 0.0 g: 1 b: 0.0)) label: 'Apply' - do: [aPermutation apply. - self sandblockEditor sendNewPermutationNotification]; + do: [aPermutation apply]; makeSmall; cornerStyle: #squared ] diff --git a/packages/Sandblocks-Utils/SBPermutation.class.st b/packages/Sandblocks-Utils/SBPermutation.class.st index 3ee44c2c..e780645f 100644 --- a/packages/Sandblocks-Utils/SBPermutation.class.st +++ b/packages/Sandblocks-Utils/SBPermutation.class.st @@ -54,6 +54,9 @@ SBPermutation >> apply [ self referencedVariants do: [:aVariant | aVariant switchToAlternative: (self at: aVariant id)]. (Set newFrom: (referencedVariants collect: #containingArtefact thenSelect: #isMethod)) do: [:aMethodBlock | aMethodBlock sandblockEditor save: aMethodBlock tryFixing: true quick: true]. + ((Set newFrom: (referencedVariants collect: #sandblockEditor)) + reject: #isNil) + do: #sendNewPermutationNotification ] { #category : #converting }