From ef448df1211c6f21fccb88f5c9206a25f205ae13 Mon Sep 17 00:00:00 2001 From: YannLEGOFF Date: Mon, 3 Jul 2023 16:53:56 +0200 Subject: [PATCH] [FT] - change space backgroud --- .../PyramidOverlayBuilder.class.st | 3 +- .../PyramidOverlaysManagerFactory.class.st | 6 +++ .../PyramidSelectionMakerController.class.st | 44 +++++++++++++++++-- .../PyramidTreePresenter.class.st | 4 +- 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/src/Pyramid-Bloc/PyramidOverlayBuilder.class.st b/src/Pyramid-Bloc/PyramidOverlayBuilder.class.st index 69a41bfb..5f4445a7 100644 --- a/src/Pyramid-Bloc/PyramidOverlayBuilder.class.st +++ b/src/Pyramid-Bloc/PyramidOverlayBuilder.class.st @@ -250,7 +250,8 @@ PyramidOverlayBuilder >> model [ { #category : #accessing } PyramidOverlayBuilder >> model: anObject [ - model := anObject + model := anObject. + self overlay model: anObject ] { #category : #accessing } diff --git a/src/Pyramid-Bloc/PyramidOverlaysManagerFactory.class.st b/src/Pyramid-Bloc/PyramidOverlaysManagerFactory.class.st index 2cf7a947..407f9552 100644 --- a/src/Pyramid-Bloc/PyramidOverlaysManagerFactory.class.st +++ b/src/Pyramid-Bloc/PyramidOverlaysManagerFactory.class.st @@ -18,6 +18,12 @@ PyramidOverlaysManagerFactory class >> editManager [ factory at: #size put: 600 @ 400. factory at: #origin put: 50 @ 50. factory at: #editor put: nil. + factory at: #spaceColor put: Color gray. + + (factory model at: #spaceColor) + subcribe: factory + with: [ :color | factory manager space root background: color ]. + (factory model at: #spaceColor)triggerCallbacks. factory manager space when: BlKeyDownEvent do: [ :evt | (factory model at: #keyboardPressed) object add: evt key. diff --git a/src/Pyramid-Bloc/PyramidSelectionMakerController.class.st b/src/Pyramid-Bloc/PyramidSelectionMakerController.class.st index fb19ace4..e7543ef9 100644 --- a/src/Pyramid-Bloc/PyramidSelectionMakerController.class.st +++ b/src/Pyramid-Bloc/PyramidSelectionMakerController.class.st @@ -145,9 +145,7 @@ PyramidSelectionMakerController >> endDragEvent: evt [ ifFalse: [ self computeNewSelectionInBounds: self elementPreview boundsInSpace ]. - evt secondaryButtonPressed ifTrue: [ - (self subMenu builder - menuFor: self activeProject selection) openWithSpecAt: self currentHand position ] + evt secondaryButtonPressed ifTrue: [ self showSubMenu ] ] { #category : #initialization } @@ -220,6 +218,46 @@ PyramidSelectionMakerController >> selectionStrategy: anObject [ selectionStrategy := anObject ] +{ #category : #'as yet unclassified' } +PyramidSelectionMakerController >> showSubMenu [ + + | menu | + menu := self subMenu builder menuFor: self activeProject selection. + menu addGroup: [ :group | + group addItem: [ :item | + item + name: 'Space backgorund color'; + subMenu: (SpMenuPresenter new + addItem: [ :subItem | + subItem + name: 'Color black'; + icon: [ + (self overlay model at: #spaceColor) object = Color black + ifTrue: [ self iconNamed: #testGreen ] + ifFalse: [ self iconNamed: #testNotRun ] ]; + action: [ + (self overlay model at: #spaceColor) object: Color black ] ]; + addItem: [ :subItem | + subItem + name: 'Color gray'; + icon: [ + (self overlay model at: #spaceColor) object = Color gray + ifTrue: [ self iconNamed: #testGreen ] + ifFalse: [ self iconNamed: #testNotRun ] ]; + action: [ + (self overlay model at: #spaceColor) object: Color gray ] ]; + addItem: [ :subItem | + subItem + name: 'Color white'; + icon: [ + (self overlay model at: #spaceColor) object = Color white + ifTrue: [ self iconNamed: #testGreen ] + ifFalse: [ self iconNamed: #testNotRun ] ]; + action: [ + (self overlay model at: #spaceColor) object: Color white ] ]) ] ]. + menu openWithSpecAt: self currentHand position +] + { #category : #'as yet unclassified' } PyramidSelectionMakerController >> startDragEvent [ diff --git a/src/Pyramid-Bloc/PyramidTreePresenter.class.st b/src/Pyramid-Bloc/PyramidTreePresenter.class.st index 40366109..c28086f1 100644 --- a/src/Pyramid-Bloc/PyramidTreePresenter.class.st +++ b/src/Pyramid-Bloc/PyramidTreePresenter.class.st @@ -29,8 +29,8 @@ PyramidTreePresenter >> connectOn: aPyramidEditor [ PyramidTreePresenter >> contextMenu [ | menu | - menu := (self editor window services at: #selectionMenu) builder menuFor: self editor activeProject selection. - + menu := (self editor window services at: #selectionMenu) builder + menuFor: self editor activeProject selection. ^ menu ]