Skip to content

Commit

Permalink
Use magic buttons for the layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyan11 committed May 1, 2024
1 parent 34b8371 commit 8b5e687
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 193 deletions.
48 changes: 44 additions & 4 deletions src/Pyramid-Bloc/PyramidBlocLayoutPlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,52 @@ PyramidBlocLayoutPlugin class >> layout [

| property |
property := PyramidProperty new
name: 'Layout';
command:
PyramidLayoutBlocCommand new;
name: 'Layout Type';
command: PyramidLayoutBlocCommand new;
pyramidInputPresenterClass:
PyramidLayoutInputPresenter;
PyramidMagicButtonsInputPresenter;
yourself.
property pyramidInputPresenterStrings
addButtonModel: (PyramidMagicButtonModel new
icon: (self iconNamed: #radioButtonUnselected);
helpSelected: 'The element have no layout.';
helpNotSelected: 'No layout.';
label: 'Basic';
inputValue: BlBasicLayout new;
inputValidation: [ :value | value class = BlBasicLayout ];
yourself);
addButtonModel: (PyramidMagicButtonModel new
icon: (self iconNamed: #smallLeftFlush);
helpSelected: 'The layout is linear.';
helpNotSelected: 'Set the layout to linear.';
label: 'Linear';
inputValue: [ BlLinearLayout vertical ];
inputValidation: [ :value | value class = BlLinearLayout ];
yourself);
addButtonModel: (PyramidMagicButtonModel new
icon: (self iconNamed: #smallJustified);
helpSelected: 'The layout is flow.';
helpNotSelected: 'Set the layout to flow.';
label: 'Flow';
inputValue: [ BlFlowLayout vertical ];
inputValidation: [ :value | value class = BlFlowLayout ];
yourself);
addButtonModel: (PyramidMagicButtonModel new
icon: (self iconNamed: #windowMaximize);
helpSelected: 'The layout is frame.';
helpNotSelected: 'Set the layout to frame.';
label: 'Frame';
inputValue: [ BlFrameLayout new ];
inputValidation: [ :value | value class = BlFrameLayout ];
yourself);
addButtonModel: (PyramidMagicButtonModel new
icon: (self iconNamed: #haloScale);
helpSelected: 'The layout is proportionnal.';
helpNotSelected: 'Set the layout to proportionnal.';
label: 'Prop';
inputValue: [ BlProportionalLayout new ];
inputValidation: [ :value | value class = BlProportionalLayout ];
yourself).
^ property
]

Expand Down
133 changes: 0 additions & 133 deletions src/Pyramid-Bloc/PyramidLayoutInputPresenter.class.st

This file was deleted.

56 changes: 0 additions & 56 deletions src/Pyramid-Tests/PyramidLayoutInputPresenterTest.class.st

This file was deleted.

0 comments on commit 8b5e687

Please sign in to comment.