Skip to content

Commit 11bb129

Browse files
Merge pull request #272 from OpenSmock/devStage
Add Shadows + fix issue remove/undo #187
2 parents deabcf8 + 1fdc78e commit 11bb129

155 files changed

Lines changed: 1090 additions & 349 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Pyramid-Bloc/PyramidAbstractBorderCommand.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ PyramidAbstractBorderCommand >> borderBuilderOf: aBlElement [
2020
^ builder
2121
]
2222

23-
{ #category : #'as yet unclassified' }
23+
{ #category : #setter }
2424
PyramidAbstractBorderCommand >> setValueFor: aBlElement with: anArgument [
2525

2626
| builder |

src/Pyramid-Bloc/PyramidAbstractChangeDrawOrderCommand.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ PyramidAbstractChangeDrawOrderCommand >> canBeUsedFor: anObject [
1616
^ (super canBeUsedFor: anObject) and: [ anObject hasParent]
1717
]
1818

19-
{ #category : #'as yet unclassified' }
19+
{ #category : #getter }
2020
PyramidAbstractChangeDrawOrderCommand >> getValueFor: aBlElement [
2121
"return current index for testing."
2222

src/Pyramid-Bloc/PyramidAddChildCommand.class.st

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,27 @@ Class {
44
#category : #'Pyramid-Bloc-plugin-bloc'
55
}
66

7-
{ #category : #'as yet unclassified' }
7+
{ #category : #history }
88
PyramidAddChildCommand >> commandInverse [
99

1010
^ PyramidRemoveChildCommand new
1111
]
1212

13-
{ #category : #'as yet unclassified' }
13+
{ #category : #private }
14+
PyramidAddChildCommand >> savedIndexFor: aChild in: aParent [
15+
16+
| index |
17+
index := aChild userData at: #pyramidRemovedAtIndex ifAbsent: [ 0 ].
18+
(index = 0 or: [ index > aParent children size ])
19+
ifTrue: [ ^ aParent children size + 1 ]
20+
ifFalse: [ ^ index ]
21+
]
22+
23+
{ #category : #setter }
1424
PyramidAddChildCommand >> setValueFor: aBlElement with: aChildToAdd [
1525

16-
aBlElement addChild: aChildToAdd
26+
aBlElement
27+
addChild: aChildToAdd
28+
at: (self savedIndexFor: aChildToAdd in: aBlElement).
29+
aChildToAdd userData removeKey: #pyramidRemovedAtIndex ifAbsent: [ ]
1730
]

src/Pyramid-Bloc/PyramidAddChildrenCommand.class.st

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Class {
44
#category : #'Pyramid-Bloc-plugin-bloc'
55
}
66

7-
{ #category : #'as yet unclassified' }
7+
{ #category : #history }
88
PyramidAddChildrenCommand >> commandInverse [
99

1010
^ PyramidRemoveChildrenCommand new
1111
]
1212

13-
{ #category : #'as yet unclassified' }
13+
{ #category : #setter }
1414
PyramidAddChildrenCommand >> setValueFor: aBlElement with: aChildrenToAdd [
1515

16-
aBlElement addChildren: aChildrenToAdd
16+
aBlElement addChildren: aChildrenToAdd
1717
]

src/Pyramid-Bloc/PyramidBackgroundBlocPlugin.class.st

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,86 @@ PyramidBackgroundBlocPlugin class >> outskirts [
671671
^ property
672672
]
673673

674+
{ #category : #accessing }
675+
PyramidBackgroundBlocPlugin class >> shadow [
676+
677+
| property |
678+
property := PyramidProperty new
679+
name: 'Shadow Effect';
680+
command: PyramidShadowCommand current;
681+
inputPresenterClass: PyramidMagicButtonsInputPresenter;
682+
yourself.
683+
property inputPresenterModel
684+
addButtonModel: (PyramidMagicButtonModel new
685+
icon: (Smalltalk ui icons iconNamed: #blank);
686+
helpSelected: 'No shadow.';
687+
helpNotSelected: 'Remove shadow.';
688+
label: 'None';
689+
inputValue: [ BlNullEffect new ];
690+
inputValidation: [ :value | value class = BlNullEffect ];
691+
yourself);
692+
addButtonModel: (PyramidMagicButtonModel new
693+
icon: (Smalltalk ui icons iconNamed: #windowMaximize);
694+
helpSelected: 'Shadow type is simple.';
695+
helpNotSelected: 'Set shadow type to simple.';
696+
label: 'Simple';
697+
inputValue: [ PyramidShadowCommand current lastSimpleShadow ];
698+
inputValidation: [ :value | value class = BlSimpleShadowEffect ];
699+
yourself);
700+
addButtonModel: (PyramidMagicButtonModel new
701+
icon: (Smalltalk ui icons iconNamed: #radioButtonUnselected);
702+
helpSelected: 'Shadow type is gaussian.';
703+
helpNotSelected: 'Set shadow type to gaussian.';
704+
label: 'Gaussian';
705+
inputValue: [ PyramidShadowCommand current lastGaussianShadow ];
706+
inputValidation: [ :value | value class = BlGaussianShadowEffect ];
707+
yourself).
708+
^ property
709+
]
710+
711+
{ #category : #accessing }
712+
PyramidBackgroundBlocPlugin class >> shadowColor [
713+
714+
| property |
715+
property := PyramidProperty new
716+
name: 'Shadow Color';
717+
command: PyramidShadowColorCommand new;
718+
inputPresenterClass:
719+
PyramidColorInputSingleLineWithPickupButtonPresenter;
720+
yourself.
721+
^ property
722+
723+
724+
]
725+
726+
{ #category : #accessing }
727+
PyramidBackgroundBlocPlugin class >> shadowOffset [
728+
729+
| property |
730+
property := PyramidProperty new
731+
name: 'Shadow Offset';
732+
command: PyramidShadowOffsetCommand new;
733+
inputPresenterClass:
734+
PyramidPointInputPresenter;
735+
yourself.
736+
property inputPresenterModel help:
737+
'Set the position x and y for the shadow offset'.
738+
^ property
739+
]
740+
741+
{ #category : #accessing }
742+
PyramidBackgroundBlocPlugin class >> shadowWidthGaussian [
743+
744+
| property |
745+
property := PyramidProperty new
746+
name: 'Shadow Width';
747+
command: PyramidShadowGaussianWidthCommand new;
748+
inputPresenterClass: PyramidNumberInputPresenter;
749+
yourself.
750+
property inputPresenterModel help: 'Set the width value'.
751+
^ property
752+
]
753+
674754
{ #category : #adding }
675755
PyramidBackgroundBlocPlugin >> addPanelsOn: aPyramidSimpleWindow [
676756

@@ -747,7 +827,14 @@ PyramidBackgroundBlocPlugin >> initialize [
747827
propertiesManager addProperty: self class borderRadialInnerCenter.
748828
propertiesManager addProperty: self class borderRadialInnerRadius.
749829
propertiesManager addProperty: self class borderRadialOuterCenter.
750-
propertiesManager addProperty: self class borderRadialOuterRadius
830+
propertiesManager addProperty: self class borderRadialOuterRadius.
831+
832+
"Shadow"
833+
PyramidShadowCommand resetShadowCommand.
834+
propertiesManager addProperty: self class shadow.
835+
propertiesManager addProperty: self class shadowColor.
836+
propertiesManager addProperty: self class shadowOffset.
837+
propertiesManager addProperty: self class shadowWidthGaussian
751838
]
752839

753840
{ #category : #adding }

src/Pyramid-Bloc/PyramidBackgroundImageCommand.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ PyramidBackgroundImageCommand >> canBeUsedFor: anObject [
1111
anObject background isKindOf: BlImageBackground ]
1212
]
1313

14-
{ #category : #'as yet unclassified' }
14+
{ #category : #getter }
1515
PyramidBackgroundImageCommand >> getValueFor: aBlElement [
1616

1717
^ aBlElement background image
1818
]
1919

20-
{ #category : #'as yet unclassified' }
20+
{ #category : #setter }
2121
PyramidBackgroundImageCommand >> setValueFor: aBlElement with: anArgument [
2222

2323
aBlElement background: (BlBackground image: anArgument)

src/Pyramid-Bloc/PyramidBackgroundOpacityCommand.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Class {
44
#category : #'Pyramid-Bloc-plugin-bloc-visuals'
55
}
66

7-
{ #category : #'as yet unclassified' }
7+
{ #category : #getter }
88
PyramidBackgroundOpacityCommand >> getValueFor: aBlElement [
99

1010
^ aBlElement background opacity
1111
]
1212

13-
{ #category : #'as yet unclassified' }
13+
{ #category : #setter }
1414
PyramidBackgroundOpacityCommand >> setValueFor: aBlElement with: anArgument [
1515

1616
| background |

src/Pyramid-Bloc/PyramidBackgroundPaintColorCommand.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ PyramidBackgroundPaintColorCommand >> canBeUsedFor: anObject [
1212
anObject background paint isKindOf: BlColorPaint ] ]
1313
]
1414

15-
{ #category : #'as yet unclassified' }
15+
{ #category : #getter }
1616
PyramidBackgroundPaintColorCommand >> getValueFor: aBlElement [
1717

1818
^ aBlElement background paint color
1919
]
2020

21-
{ #category : #'as yet unclassified' }
21+
{ #category : #setter }
2222
PyramidBackgroundPaintColorCommand >> setValueFor: aBlElement with: anArgument [
2323

2424
aBlElement background: (BlBackground paint: anArgument asBlPaint)

src/Pyramid-Bloc/PyramidBackgroundPaintCommand.class.st

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ PyramidBackgroundPaintCommand >> canBeUsedFor: anObject [
1111
anObject background isKindOf: BlPaintBackground ]
1212
]
1313

14-
{ #category : #'as yet unclassified' }
14+
{ #category : #getter }
1515
PyramidBackgroundPaintCommand >> getGroupedValueFor: aBlElement [
1616

1717
^ aBlElement background paint class
1818
]
1919

20-
{ #category : #'as yet unclassified' }
20+
{ #category : #getter }
2121
PyramidBackgroundPaintCommand >> getValueFor: aBlElement [
2222

2323
^ aBlElement background paint
2424
]
2525

26-
{ #category : #'as yet unclassified' }
26+
{ #category : #setter }
2727
PyramidBackgroundPaintCommand >> setValueFor: aBlElement with: anArgument [
2828

2929
aBlElement background: (BlBackground paint: anArgument value)

src/Pyramid-Bloc/PyramidBackgroundPaintLinearEndCommand.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Class {
44
#category : #'Pyramid-Bloc-plugin-bloc-visuals'
55
}
66

7-
{ #category : #'as yet unclassified' }
7+
{ #category : #getter }
88
PyramidBackgroundPaintLinearEndCommand >> getValueFor: aBlElement [
99

1010
^ aBlElement background paint end
1111
]
1212

13-
{ #category : #'as yet unclassified' }
13+
{ #category : #setter }
1414
PyramidBackgroundPaintLinearEndCommand >> setValueFor: aBlElement with: anArgument [
1515

1616
aBlElement background paint end: anArgument

0 commit comments

Comments
 (0)