Skip to content

Commit

Permalink
[FT] - change space backgroud
Browse files Browse the repository at this point in the history
  • Loading branch information
YannLEGOFF committed Jul 3, 2023
1 parent 62d830c commit ef448df
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/Pyramid-Bloc/PyramidOverlayBuilder.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ PyramidOverlayBuilder >> model [
{ #category : #accessing }
PyramidOverlayBuilder >> model: anObject [

model := anObject
model := anObject.
self overlay model: anObject
]

{ #category : #accessing }
Expand Down
6 changes: 6 additions & 0 deletions src/Pyramid-Bloc/PyramidOverlaysManagerFactory.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
44 changes: 41 additions & 3 deletions src/Pyramid-Bloc/PyramidSelectionMakerController.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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 [

Expand Down
4 changes: 2 additions & 2 deletions src/Pyramid-Bloc/PyramidTreePresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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
]

Expand Down

0 comments on commit ef448df

Please sign in to comment.