diff --git a/src/Pyramid-Bloc/PyramidChangeTextCommand.class.st b/src/Pyramid-Bloc/PyramidChangeTextCommand.class.st index 181b72af..93a2bbda 100644 --- a/src/Pyramid-Bloc/PyramidChangeTextCommand.class.st +++ b/src/Pyramid-Bloc/PyramidChangeTextCommand.class.st @@ -18,5 +18,9 @@ PyramidChangeTextCommand >> setValueFor: aBlTextElement with: aString [ rope := aString asRopedText. attributes do: [ :a | rope attribute: a ]. - aBlTextElement text: rope + aBlTextElement text: rope. + "Fix label color on theme change when label is create during the session without copy or open from save" + aBlTextElement parent ifNil: [ ^ self ]. + (((aBlTextElement parent)class) name) = (#ToLabel) + ifTrue: [ aBlTextElement parent text: aString asRopedText ] ] diff --git a/src/Pyramid-Bloc/PyramidDrawOrderIcons.class.st b/src/Pyramid-Bloc/PyramidDrawOrderIcons.class.st index f28afcd5..b75223a1 100644 --- a/src/Pyramid-Bloc/PyramidDrawOrderIcons.class.st +++ b/src/Pyramid-Bloc/PyramidDrawOrderIcons.class.st @@ -224,7 +224,7 @@ blpaintbackground2 := BlPaintBackground new. PyramidDrawOrderIcons class >> formMoveBackward [ ^ (BlElement new - size: 16 @ 16; + extent: 16 @ 16; addChildren: self blocMoveBackward materializeAsBlElement) exportAsForm ] @@ -233,7 +233,7 @@ PyramidDrawOrderIcons class >> formMoveBackward [ PyramidDrawOrderIcons class >> formMoveForward [ ^ (BlElement new - size: 16 @ 16; + extent: 16 @ 16; addChildren: self blocMoveForward materializeAsBlElement) exportAsForm ] @@ -242,7 +242,7 @@ PyramidDrawOrderIcons class >> formMoveForward [ PyramidDrawOrderIcons class >> formOnBackground [ ^ (BlElement new - size: 16 @ 16; + extent: 16 @ 16; addChildren: self blocOnBackground materializeAsBlElement) exportAsForm ] @@ -251,7 +251,7 @@ PyramidDrawOrderIcons class >> formOnBackground [ PyramidDrawOrderIcons class >> formOnForeground [ ^ (BlElement new - size: 16 @ 16; + extent: 16 @ 16; addChildren: self blocOnForeground materializeAsBlElement) exportAsForm ] diff --git a/src/Pyramid-Bloc/PyramidLibraryDefault.class.st b/src/Pyramid-Bloc/PyramidLibraryDefault.class.st index 21f089a6..bf869e6a 100644 --- a/src/Pyramid-Bloc/PyramidLibraryDefault.class.st +++ b/src/Pyramid-Bloc/PyramidLibraryDefault.class.st @@ -87,7 +87,7 @@ PyramidLibraryDefault >> smalltalkIconsCategory [ name: each key; block: [ { (BlElement new - size: each value extent; + extent: each value extent; background: (BlImageBackground image: (PyramidExternalRessourceProxy fromSource: diff --git a/src/Pyramid-Bloc/PyramidSelectionMakerExtension.class.st b/src/Pyramid-Bloc/PyramidSelectionMakerExtension.class.st index f7620e6d..45d83347 100644 --- a/src/Pyramid-Bloc/PyramidSelectionMakerExtension.class.st +++ b/src/Pyramid-Bloc/PyramidSelectionMakerExtension.class.st @@ -75,10 +75,10 @@ PyramidSelectionMakerExtension >> dragEvent: anEvent [ xmin := self dragOrigin x min: anEvent position x. ymin := self dragOrigin y min: anEvent position y. - + self selectionGhost position: xmin @ ymin; - size: (anEvent position - self dragOrigin) abs + extent: (anEvent position - self dragOrigin) abs ] { #category : #accessing } @@ -100,7 +100,7 @@ PyramidSelectionMakerExtension >> dragStart: anEvent [ self dragOrigin: anEvent position. self selectionGhost - size: 0 @ 0; + extent: 0 @ 0; position: self dragOrigin; visibility: BlVisibility visible ] diff --git a/src/Pyramid-Bloc/PyramidVisualPystonForCly.class.st b/src/Pyramid-Bloc/PyramidVisualPystonForCly.class.st index 9097fd6b..bd92ec7f 100644 --- a/src/Pyramid-Bloc/PyramidVisualPystonForCly.class.st +++ b/src/Pyramid-Bloc/PyramidVisualPystonForCly.class.st @@ -89,7 +89,7 @@ PyramidVisualPystonForCly >> build [ blElement isCollection ifTrue: [ blElement := BlElement new addChildren: blElement; - size: 1500 @ 1500; + extent: 1500 @ 1500; yourself ]. imageMorph := ImageMorph withForm: blElement exportAsForm. self addMorph: imageMorph fullFrame: LayoutFrame identity. @@ -242,7 +242,7 @@ PyramidVisualPystonForCly >> update [ blElement isCollection ifTrue: [ blElement := BlElement new addChildren: blElement; - size: 1500 @ 1500; + extent: 1500 @ 1500; yourself ]. imageMorph form: blElement exportAsForm diff --git a/src/Pyramid-Toplo/PyramidAddStampPresenter.class.st b/src/Pyramid-Toplo/PyramidAddStampPresenter.class.st new file mode 100644 index 00000000..fa18fd7d --- /dev/null +++ b/src/Pyramid-Toplo/PyramidAddStampPresenter.class.st @@ -0,0 +1,85 @@ +Class { + #name : #PyramidAddStampPresenter, + #superclass : #SpPresenter, + #instVars : [ + 'stampManagerPresenter', + 'treeTableAddStamp', + 'selectedStampToAdd', + 'addStampButton' + ], + #category : #'Pyramid-Toplo-plugin-theme-management' +} + +{ #category : #adding } +PyramidAddStampPresenter >> addSelectedStampToElement [ + + selectedStampToAdd ifNil: [ ^ self ]. + + selectedStampToAdd command + setValueFor: self stampManagerPresenter currentSelectedElement + with: true. + + self refreshStampTreeTable. +] + +{ #category : #accessing } +PyramidAddStampPresenter >> addStampButton [ + + ^ addStampButton +] + +{ #category : #layout } +PyramidAddStampPresenter >> defaultLayout [ + + | defaultLayout stampToolBarAddButton | + + defaultLayout := SpBoxLayout newVertical spacing: 6; yourself. + + stampToolBarAddButton := SpBoxLayout newHorizontal hAlignStart; yourself. + stampToolBarAddButton add: addStampButton width: 380. + + defaultLayout add: treeTableAddStamp expand: true. + defaultLayout add: stampToolBarAddButton expand: false. + + ^ defaultLayout +] + +{ #category : #'initialization - deprecated' } +PyramidAddStampPresenter >> initializePresenter [ + + addStampButton := SpButtonPresenter new + label: 'Add Stamp'; + icon: (Smalltalk ui icons iconNamed: #add); + whenActivatedDo: [ self addSelectedStampToElement ]. + + treeTableAddStamp := SpTreeTablePresenter new. + treeTableAddStamp whenSelectedItemChangedDo: [ :aStampSelected | selectedStampToAdd := aStampSelected ]. + treeTableAddStamp addColumn: (SpCompositeTableColumn new + title: 'List of stamps'; + addColumn: (SpStringTableColumn evaluated: #name); + yourself). +] + +{ #category : #adding } +PyramidAddStampPresenter >> refreshStampTreeTable [ + + self stampManagerPresenter refreshStampTreeTable +] + +{ #category : #accessing } +PyramidAddStampPresenter >> stampManagerPresenter [ + + ^ stampManagerPresenter +] + +{ #category : #accessing } +PyramidAddStampPresenter >> stampManagerPresenter: aPyramidStampManagerPresenter [ + + stampManagerPresenter := aPyramidStampManagerPresenter +] + +{ #category : #accessing } +PyramidAddStampPresenter >> treeTableAddStamp [ + + ^ treeTableAddStamp +] diff --git a/src/Pyramid-Toplo/PyramidContainsValidSelectorInterpreter.class.st b/src/Pyramid-Toplo/PyramidContainsValidSelectorInterpreter.class.st index ac8141fd..5148858e 100644 --- a/src/Pyramid-Toplo/PyramidContainsValidSelectorInterpreter.class.st +++ b/src/Pyramid-Toplo/PyramidContainsValidSelectorInterpreter.class.st @@ -7,7 +7,7 @@ Class { 'invalidSelectors', 'ignoredSelectors' ], - #category : #'Pyramid-Toplo-EXPERIMENTAL-plugin-theme-management' + #category : #'Pyramid-Toplo-plugin-theme-management' } { #category : #operating } diff --git a/src/Pyramid-Toplo/PyramidElementThemeSelectorPresenter.class.st b/src/Pyramid-Toplo/PyramidElementThemeSelectorPresenter.class.st index 326543f5..b9ff7dfb 100644 --- a/src/Pyramid-Toplo/PyramidElementThemeSelectorPresenter.class.st +++ b/src/Pyramid-Toplo/PyramidElementThemeSelectorPresenter.class.st @@ -3,12 +3,13 @@ Class { #superclass : #PyramidThemeSelectorPresenter, #instVars : [ 'projectModel', + 'themePropertyManager', 'inheritSelector', 'labelPresenter', 'commandExecutor', 'themeCommand' ], - #category : #'Pyramid-Toplo-EXPERIMENTAL-plugin-theme-management' + #category : #'Pyramid-Toplo-plugin-theme-management' } { #category : #'as yet unclassified' } @@ -67,7 +68,7 @@ PyramidElementThemeSelectorPresenter >> elementsOrSelectionChanged: anEvent [ self triggerThemeChangement: false. self updatePresenterFor: anEvent selection. - self triggerThemeChangement: true + self triggerThemeChangement: true. ] { #category : #accessing } @@ -83,7 +84,7 @@ PyramidElementThemeSelectorPresenter >> initializePresenters [ themeCommand := PyramidThemeCommand new. inheritSelector := SpCheckBoxPresenter new label: 'Inherits from parents'; - whenChangedDo: [ :aBoolean | self applyTheme ]; + whenChangedDo: [ :aBoolean | self applyTheme. self themeSelector enabled: (aBoolean not) ]; yourself. labelPresenter := SpLabelPresenter new label: 'Element Theme (empty select)'; @@ -110,11 +111,11 @@ PyramidElementThemeSelectorPresenter >> projectModel [ PyramidElementThemeSelectorPresenter >> projectModel: aPyramidProjectModel [ projectModel := aPyramidProjectModel. - projectModel + projectModel announcer when: PyramidElementsChangedEvent do: [ :evt | self elementsOrSelectionChanged: evt ] for: self. - projectModel + projectModel announcer when: PyramidSelectionChangedEvent do: [ :evt | self elementsOrSelectionChanged: evt ] for: self. @@ -170,7 +171,5 @@ PyramidElementThemeSelectorPresenter >> updatePresenterFor: aCollectionOfElement collectionOfLocalThemes first ifNotNil: [ self inheritSelector state: false. self themeSelector enabled: true. - self selectTheme: collectionOfLocalThemes first ]. - - self layout: self defaultLayout + self selectTheme: collectionOfLocalThemes first ] ] diff --git a/src/Pyramid-Toplo/PyramidSelectorPossibleStamps.class.st b/src/Pyramid-Toplo/PyramidSelectorPossibleStamps.class.st index db4cdaf0..0cf44247 100644 --- a/src/Pyramid-Toplo/PyramidSelectorPossibleStamps.class.st +++ b/src/Pyramid-Toplo/PyramidSelectorPossibleStamps.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'theme' ], - #category : #'Pyramid-Toplo-EXPERIMENTAL-plugin-theme-management' + #category : #'Pyramid-Toplo-plugin-theme-management' } { #category : #'as yet unclassified' } diff --git a/src/Pyramid-Toplo/PyramidSpaceThemeSelectorPresenter.class.st b/src/Pyramid-Toplo/PyramidSpaceThemeSelectorPresenter.class.st index 2895affd..218da56f 100644 --- a/src/Pyramid-Toplo/PyramidSpaceThemeSelectorPresenter.class.st +++ b/src/Pyramid-Toplo/PyramidSpaceThemeSelectorPresenter.class.st @@ -6,7 +6,7 @@ Class { #instVars : [ 'projectModel' ], - #category : #'Pyramid-Toplo-EXPERIMENTAL-plugin-theme-management' + #category : #'Pyramid-Toplo-plugin-theme-management' } { #category : #'as yet unclassified' } @@ -16,6 +16,29 @@ PyramidSpaceThemeSelectorPresenter >> applyTheme [ self projectModel informElementsChanged ] +{ #category : #accessing } +PyramidSpaceThemeSelectorPresenter >> builder [ + + ^ builder +] + +{ #category : #accessing } +PyramidSpaceThemeSelectorPresenter >> builder: anObject [ + + builder:= anObject. +] + +{ #category : #accessing } +PyramidSpaceThemeSelectorPresenter >> editor: aPyramidEditor [ +] + +{ #category : #displaying } +PyramidSpaceThemeSelectorPresenter >> installOn: aBuilder [ + + self builder: aBuilder. + +] + { #category : #initialization } PyramidSpaceThemeSelectorPresenter >> labelPresenter [ diff --git a/src/Pyramid-Toplo/PyramidStampCommand.class.st b/src/Pyramid-Toplo/PyramidStampCommand.class.st index 5bee137e..2ec2f0c1 100644 --- a/src/Pyramid-Toplo/PyramidStampCommand.class.st +++ b/src/Pyramid-Toplo/PyramidStampCommand.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'stamp' ], - #category : #'Pyramid-Toplo-EXPERIMENTAL-plugin-theme-management' + #category : #'Pyramid-Toplo-plugin-theme-management' } { #category : #'as yet unclassified' } diff --git a/src/Pyramid-Toplo/PyramidStampManagerPresenter.class.st b/src/Pyramid-Toplo/PyramidStampManagerPresenter.class.st new file mode 100644 index 00000000..28368742 --- /dev/null +++ b/src/Pyramid-Toplo/PyramidStampManagerPresenter.class.st @@ -0,0 +1,230 @@ +Class { + #name : #PyramidStampManagerPresenter, + #superclass : #SpPresenter, + #instVars : [ + 'projectModel', + 'styleSheetEditor', + 'treeTableStamp', + 'pyramidPropertiesStrategy', + 'stampPresenterLabel', + 'selectedStamp', + 'removeStampButton', + 'currentSelectedElement', + 'treeTableAddStampPresenter', + 'selectedStampEquipped', + 'selectedStampToAdd', + 'addStampButton' + ], + #category : #'Pyramid-Toplo-plugin-theme-management' +} + +{ #category : #adding } +PyramidStampManagerPresenter >> addRootsStampAddTreeTable: aElement [ + + | collectionOfStamps | + + collectionOfStamps := pyramidPropertiesStrategy propertiesFor: aElement. + + ^ collectionOfStamps. +] + +{ #category : #'as yet unclassified' } +PyramidStampManagerPresenter >> allStampFromElement: aElement [ + + | stampsCollection collectionOfStamps classStampToRemove | + stampsCollection := OrderedCollection new. + collectionOfStamps := OrderedCollection new. + + aElement allStamps do: [ :aStamp | + stampsCollection add: (PyramidProperty new + name: aStamp; + command: (PyramidStampCommand new + stamp: aStamp; + yourself)) ]. + + stampsCollection isEmpty ifTrue: [ + treeTableStamp roots: { }. + ^ self ]. + + treeTableStamp roots: stampsCollection asArray +] + +{ #category : #accessing } +PyramidStampManagerPresenter >> currentSelectedElement [ + + ^ currentSelectedElement +] + +{ #category : #layout } +PyramidStampManagerPresenter >> defaultLayout [ + + | defaultLayout stampPresenterTree stampPresenterLabelLine stampToolBarButton addStampButtonToolBar removeStampButtonToolBar | + + defaultLayout := SpBoxLayout newVertical + spacing: 6; + yourself. + + stampPresenterLabelLine := SpBoxLayout newHorizontal + hAlignStart; + yourself. + stampPresenterLabelLine add: stampPresenterLabel. + + stampToolBarButton := SpBoxLayout newHorizontal + hAlign; + yourself. + + addStampButtonToolBar := SpBoxLayout newHorizontal + hAlignStart; + yourself. + + removeStampButtonToolBar := SpBoxLayout newHorizontal + hAlignEnd; + yourself. + + addStampButtonToolBar add: addStampButton width: 125. + removeStampButtonToolBar add: removeStampButton width: 125. + + stampToolBarButton add: addStampButtonToolBar. + stampToolBarButton add: removeStampButtonToolBar. + + stampPresenterTree := SpBoxLayout newVertical. + stampPresenterTree add: treeTableStamp. + + defaultLayout add: stampPresenterLabelLine expand: false. + defaultLayout add: stampToolBarButton expand: false. + defaultLayout add: stampPresenterTree expand: true. + + ^ defaultLayout +] + +{ #category : #'as yet unclassified' } +PyramidStampManagerPresenter >> elementsOrSelectionChanged: anEvent [ + + (anEvent selection isEmpty or:[ anEvent selection size > 1 ]) + ifTrue: [ treeTableStamp roots: { }. addStampButton disable. ^ self ]. + + currentSelectedElement := anEvent selection first. + self allStampFromElement: currentSelectedElement. + addStampButton enable. +] + +{ #category : #'initialization - deprecated' } +PyramidStampManagerPresenter >> initializePresenter [ + + stampPresenterLabel := SpLabelPresenter new + displayBold: [ true ]; + label: 'Selected element stamp :'; + yourself. + + addStampButton := SpButtonPresenter new + label: 'Add Stamp'; + icon: (Smalltalk ui icons iconNamed: #add); + whenActivatedDo: [ self openModalAddStampTreeTable ]; + disable. + + removeStampButton := SpButtonPresenter new + label: 'Remove Stamp'; + icon: (Smalltalk ui icons iconNamed: #cancel); + whenActivatedDo: [ self removeSelectedStamp: selectedStampEquipped ]; + disable. + + treeTableStamp := SpTreeTablePresenter new. + treeTableStamp whenSelectedItemChangedDo: [ :aStampSelected | selectedStampEquipped := aStampSelected. + selectedStampEquipped + ifNil: [ removeStampButton disable ] + ifNotNil: [ removeStampButton enable ] ]. + treeTableStamp addColumn: (SpCompositeTableColumn new + title: 'Stamp'; + addColumn: (SpStringTableColumn evaluated: #name); + yourself). + + treeTableAddStampPresenter := PyramidAddStampPresenter new + stampManagerPresenter: self. + +] + +{ #category : #'as yet unclassified' } +PyramidStampManagerPresenter >> openModalAddStampTreeTable [ + + | dialog window | + + projectModel selection isEmpty + ifTrue: [ ^ self ]. + projectModel selection size > 1 + ifTrue: [ ^ self ]. + + window := treeTableAddStampPresenter asModalWindow. + treeTableAddStampPresenter treeTableAddStamp roots: (self addRootsStampAddTreeTable: currentSelectedElement). + window title: 'Add stamp to the selected element'. + "To center the window when open" + "window centered." + dialog := window open. +] + +{ #category : #accessing } +PyramidStampManagerPresenter >> projectModel [ + + ^ projectModel +] + +{ #category : #accessing } +PyramidStampManagerPresenter >> projectModel: aPyramidProjectModel [ + + projectModel := aPyramidProjectModel. + projectModel announcer + when: PyramidElementsChangedEvent + do: [ :evt | self elementsOrSelectionChanged: evt ] + for: self. + projectModel announcer + when: PyramidSelectionChangedEvent + do: [ :evt | self elementsOrSelectionChanged: evt ] + for: self. +] + +{ #category : #accessing } +PyramidStampManagerPresenter >> pyramidPropertiesStrategy [ + + ^ pyramidPropertiesStrategy +] + +{ #category : #accessing } +PyramidStampManagerPresenter >> pyramidPropertiesStrategy: aPyramidPropertiesStrategy [ + + pyramidPropertiesStrategy := aPyramidPropertiesStrategy +] + +{ #category : #adding } +PyramidStampManagerPresenter >> refreshStampTreeTable [ + + self allStampFromElement: currentSelectedElement. +] + +{ #category : #removing } +PyramidStampManagerPresenter >> removeSelectedStamp: aSelectedStamp [ + + selectedStampEquipped ifNil: [ ^ self ]. + + selectedStampEquipped command + setValueFor: currentSelectedElement + with: false. + + self refreshStampTreeTable. +] + +{ #category : #accessing } +PyramidStampManagerPresenter >> styleSheetEditor [ + + ^ styleSheetEditor +] + +{ #category : #accessing } +PyramidStampManagerPresenter >> styleSheetEditor: aStyleSheetEditor [ + + styleSheetEditor := aStyleSheetEditor +] + +{ #category : #accessing } +PyramidStampManagerPresenter >> treeTableStamp [ + + ^ treeTableStamp +] diff --git a/src/Pyramid-Toplo/PyramidStyleSheetEditorPresenter.class.st b/src/Pyramid-Toplo/PyramidStyleSheetEditorPresenter.class.st deleted file mode 100644 index b4e494ef..00000000 --- a/src/Pyramid-Toplo/PyramidStyleSheetEditorPresenter.class.st +++ /dev/null @@ -1,41 +0,0 @@ -Class { - #name : #PyramidStyleSheetEditorPresenter, - #superclass : #SpPresenter, - #instVars : [ - 'themeSelector', - 'styleSheetEditor', - 'stampPresenter' - ], - #category : #'Pyramid-Toplo-EXPERIMENTAL-plugin-theme-management' -} - -{ #category : #accessing } -PyramidStyleSheetEditorPresenter >> defaultLayout [ - - ^ SpBoxLayout new - spacing: 4; - add: (SpLabelPresenter new - label: 'Stamps edition'; - displayBold: [ :t | true ]; - yourself) expand: false; - add: self stampPresenter expand: true; - yourself -] - -{ #category : #initialization } -PyramidStyleSheetEditorPresenter >> initializePresenters [ - - stampPresenter := SpNullPresenter new -] - -{ #category : #accessing } -PyramidStyleSheetEditorPresenter >> stampPresenter [ - - ^ stampPresenter -] - -{ #category : #accessing } -PyramidStyleSheetEditorPresenter >> stampPresenter: anObject [ - - stampPresenter := anObject -] diff --git a/src/Pyramid-Toplo/PyramidThemeCommand.class.st b/src/Pyramid-Toplo/PyramidThemeCommand.class.st index 9bcd10fc..66c4f825 100644 --- a/src/Pyramid-Toplo/PyramidThemeCommand.class.st +++ b/src/Pyramid-Toplo/PyramidThemeCommand.class.st @@ -1,7 +1,7 @@ Class { #name : #PyramidThemeCommand, #superclass : #PyramidAbstractBlocCommand, - #category : #'Pyramid-Toplo-EXPERIMENTAL-plugin-theme-management' + #category : #'Pyramid-Toplo-plugin-theme-management' } { #category : #'as yet unclassified' } diff --git a/src/Pyramid-Toplo/PyramidThemeFromSpaceExtension.class.st b/src/Pyramid-Toplo/PyramidThemeFromSpaceExtension.class.st index a6aea11b..0be9f984 100644 --- a/src/Pyramid-Toplo/PyramidThemeFromSpaceExtension.class.st +++ b/src/Pyramid-Toplo/PyramidThemeFromSpaceExtension.class.st @@ -8,7 +8,7 @@ Class { 'themeSpaceSelector', 'spaceIsReady' ], - #category : #'Pyramid-Toplo-EXPERIMENTAL-plugin-theme-management' + #category : #'Pyramid-Toplo-plugin-theme-management' } { #category : #asserting } diff --git a/src/Pyramid-Toplo/PyramidThemePresenter.class.st b/src/Pyramid-Toplo/PyramidThemePresenter.class.st index 0cf8089b..761f071f 100644 --- a/src/Pyramid-Toplo/PyramidThemePresenter.class.st +++ b/src/Pyramid-Toplo/PyramidThemePresenter.class.st @@ -2,11 +2,13 @@ Class { #name : #PyramidThemePresenter, #superclass : #SpPresenter, #instVars : [ + 'projectModel', 'styleSheetEditor', 'themeSpaceSelector', - 'themeElementSelector' + 'themeElementSelector', + 'treeTableStampPresenter' ], - #category : #'Pyramid-Toplo-EXPERIMENTAL-plugin-theme-management' + #category : #'Pyramid-Toplo-plugin-theme-management' } { #category : #layout } @@ -15,8 +17,8 @@ PyramidThemePresenter >> defaultLayout [ ^ SpBoxLayout newVertical spacing: 4; add: self themeSpaceSelector expand: false; - add: self themeElementSelector expand: false; - add: self styleSheetEditor expand: true; + add: self themeElementSelector expand: false; + add: self treeTableStampPresenter; yourself ] @@ -34,7 +36,20 @@ PyramidThemePresenter >> initializePresenters [ themeSpaceSelector := PyramidSpaceThemeSelectorPresenter new. themeElementSelector := PyramidElementThemeSelectorPresenter new. - styleSheetEditor := PyramidStyleSheetEditorPresenter new + + treeTableStampPresenter := PyramidStampManagerPresenter new. +] + +{ #category : #accessing } +PyramidThemePresenter >> projectModel [ + + ^ projectModel +] + +{ #category : #accessing } +PyramidThemePresenter >> projectModel: aProjectModel [ + + projectModel := aProjectModel ] { #category : #'as yet unclassified' } @@ -60,3 +75,9 @@ PyramidThemePresenter >> themeSpaceSelector [ ^ themeSpaceSelector ] + +{ #category : #accessing } +PyramidThemePresenter >> treeTableStampPresenter [ + + ^ treeTableStampPresenter +] diff --git a/src/Pyramid-Toplo/PyramidThemePropertyStrategy.class.st b/src/Pyramid-Toplo/PyramidThemePropertyStrategy.class.st index 32bf4fbc..2f853a2d 100644 --- a/src/Pyramid-Toplo/PyramidThemePropertyStrategy.class.st +++ b/src/Pyramid-Toplo/PyramidThemePropertyStrategy.class.st @@ -1,17 +1,9 @@ Class { #name : #PyramidThemePropertyStrategy, #superclass : #PyramidHideEmptyPropertyStrategy, - #category : #'Pyramid-Toplo-EXPERIMENTAL-plugin-theme-management' + #category : #'Pyramid-Toplo-plugin-theme-management' } -{ #category : #'as yet unclassified' } -PyramidThemePropertyStrategy >> buildPresenterFromCollection: aCollection andManager: aManager [ - - aManager removeAllProperties. - aManager addAllProperties: (self propertiesFor: aCollection). - ^ super buildPresenterFromCollection: aCollection andManager: aManager -] - { #category : #'as yet unclassified' } PyramidThemePropertyStrategy >> propertiesFor: aCollectionOfElements [ @@ -20,12 +12,12 @@ PyramidThemePropertyStrategy >> propertiesFor: aCollectionOfElements [ asOrderedCollection select: [ :element | element isAttachedToSceneGraph and: [ - element toTheme isKindOf: + element lookupTheme isKindOf: ToStyleSheetTheme ] ]. elementsWithStyleSheetTheme ifEmpty: [ ^ { } ]. allPossibleStamps := elementsWithStyleSheetTheme collect: [ :each | PyramidSelectorPossibleStamps new - theme: each toTheme; + theme: each lookupTheme; findAllStampsFor: each ]. allCommonStamps := allPossibleStamps first. allPossibleStamps do: [ :each | @@ -37,9 +29,6 @@ PyramidThemePropertyStrategy >> propertiesFor: aCollectionOfElements [ PyramidThemePropertyStrategy >> propertyForStamp: aStamp [ | property | - property := PyramidProperty new name: aStamp; command: (PyramidStampCommand new stamp: aStamp; yourself); inputPresenterClass: PyramidSwitchInputPresenter ; yourself. - property inputPresenterModel onLabel: 'Has stamp'. - property inputPresenterModel offLabel: 'Has not stamp'. - property inputPresenterModel uncertainLabel: 'Uncertain'. + property := PyramidProperty new name: aStamp; command: (PyramidStampCommand new stamp: aStamp; yourself). ^ property ] diff --git a/src/Pyramid-Toplo/PyramidThemeSelectorPresenter.class.st b/src/Pyramid-Toplo/PyramidThemeSelectorPresenter.class.st index a270e734..61c6a357 100644 --- a/src/Pyramid-Toplo/PyramidThemeSelectorPresenter.class.st +++ b/src/Pyramid-Toplo/PyramidThemeSelectorPresenter.class.st @@ -6,7 +6,7 @@ Class { 'buttonRefreshTheme', 'triggerThemeChangement' ], - #category : #'Pyramid-Toplo-EXPERIMENTAL-plugin-theme-management' + #category : #'Pyramid-Toplo-plugin-theme-management' } { #category : #'as yet unclassified' } @@ -96,7 +96,7 @@ PyramidThemeSelectorPresenter >> labelPresenter [ PyramidThemeSelectorPresenter >> selectTheme: aToTheme [ self triggerThemeChangement: false. - self themeSelector selectItem: aToTheme. + self themeSelector items do: [:theme | (theme class) = (aToTheme class) ifTrue: [ self themeSelector selectItem: (theme) ]]. self triggerThemeChangement: true. ] diff --git a/src/Pyramid-Toplo/PyramidToploThemePlugin.class.st b/src/Pyramid-Toplo/PyramidToploThemePlugin.class.st index 7a30f73e..6744aa1a 100644 --- a/src/Pyramid-Toplo/PyramidToploThemePlugin.class.st +++ b/src/Pyramid-Toplo/PyramidToploThemePlugin.class.st @@ -7,15 +7,9 @@ Class { 'themePresenter', 'themePropertyManager' ], - #category : #'Pyramid-Toplo-EXPERIMENTAL-plugin-theme-management' + #category : #'Pyramid-Toplo-plugin-theme-management' } -{ #category : #asserting } -PyramidToploThemePlugin class >> shouldInstall [ - - ^ false -] - { #category : #adding } PyramidToploThemePlugin class >> toploAntIconCategory [ @@ -128,14 +122,20 @@ PyramidToploThemePlugin >> addPanelsOn: aPyramidSimpleWindow [ makeTab: self themePresenter label: 'Toplo-Theme' icon: (Smalltalk ui icons iconNamed: #smallPushpin) - order: 1 ] + order: 6 ] ] { #category : #actions } PyramidToploThemePlugin >> configureBuilder: aPyramidEditorBuilder [ - | spacePlugin | - spacePlugin := aPyramidEditorBuilder findPlugin: #PyramidSpacePlugin. + | spacePlugin listOfPlugins pluginSorted | + + listOfPlugins := aPyramidEditorBuilder plugins. + pluginSorted := listOfPlugins select: [ :extensions | extensions isKindOf: PyramidSpacePlugin ]. + pluginSorted size = 1 + ifFalse: [^ self]. + spacePlugin := pluginSorted asArray first. + self themePresenter pyramidSpaceBuilderConfigurationOn: spacePlugin builder ] @@ -143,7 +143,14 @@ PyramidToploThemePlugin >> configureBuilder: aPyramidEditorBuilder [ PyramidToploThemePlugin >> connectOn: aPyramidEditor [ self themePresenter editor: aPyramidEditor. - self themePropertyManager projectModel: aPyramidEditor projectModel + + self themePropertyManager projectModel: aPyramidEditor projectModel. + + self themePresenter projectModel: aPyramidEditor projectModel. + + self themePresenter treeTableStampPresenter projectModel: aPyramidEditor projectModel. + + self themePresenter treeTableStampPresenter styleSheetEditor: self themePresenter styleSheetEditor. ] { #category : #initialization } @@ -154,7 +161,8 @@ PyramidToploThemePlugin >> initialize [ presenterStrategy: PyramidThemePropertyStrategy new; yourself. - themePresenter styleSheetEditor stampPresenter: themePropertyManager mainPresenter + + themePresenter treeTableStampPresenter pyramidPropertiesStrategy: PyramidThemePropertyStrategy new. ] { #category : #accessing }