Duplicate toolbar buttons for "example" mode and add nested menu buttons

This commit is contained in:
dannyrb committed 2020-06-16 23:57:38 -04:00
1 parent 0f2bae008d
commit 10484fceec
4 files changed
+426 -51

No files matched your search

+28 -50
View File
@@ -1,3 +1,5 @@
import toolbarButtons from './toolbarButtons.js';
export default function mode({ modeConfiguration }) {
return {
id: 'example-mode',
@@ -16,57 +18,33 @@ export default function mode({ modeConfiguration }) {
init: ({ servicesManager, extensionManager }) => {
const { ToolBarService } = servicesManager.services;
ToolBarService.init(extensionManager);
ToolBarService.addButtons([
{
id: 'Zoom',
namespace: 'org.ohif.cornerstone.toolbarModule.Zoom',
},
{
id: 'Levels',
namespace: 'org.ohif.cornerstone.toolbarModule.Wwwc',
},
{
id: 'Pan',
namespace: 'org.ohif.cornerstone.toolbarModule.Pan',
},
{
id: 'Capture',
namespace: 'org.ohif.cornerstone.toolbarModule.Capture',
},
{
id: 'Layout',
namespace: 'org.ohif.default.toolbarModule.Layout',
},
{
id: 'Annotate',
namespace: 'org.ohif.cornerstone.toolbarModule.Annotate',
},
{
id: 'Bidirectional',
namespace: 'org.ohif.cornerstone.toolbarModule.Bidirectional',
},
{
id: 'Ellipse',
namespace: 'org.ohif.cornerstone.toolbarModule.Ellipse',
},
{
id: 'Length',
namespace: 'org.ohif.cornerstone.toolbarModule.Length',
},
ToolBarService.addButtons(toolbarButtons);
ToolBarService.createButtonSection('primary', [
'Zoom',
'Wwwc',
'Pan',
'Capture',
'Layout',
'Divider',
[
'ResetView',
'RotateClockwise',
'FlipHorizontally',
'StackScroll',
'Magnify',
'Invert',
'Cine',
'Angle',
'Probe',
'RectangleRoi',
],
]);
ToolBarService.createButtonSection('secondary', [
'Annotate',
'Bidirectional',
'Ellipse',
'Length',
]);
// Could import layout selector here from org.ohif.default (when it exists!)
// ToolBarService.setToolBarLayout([
// // Primary
// {
// tools: ['Zoom', 'Levels', 'Pan', 'Capture', 'Layout'],
// moreTools: ['Zoom'],
// },
// // Secondary
// {
// tools: ['Annotate', 'Bidirectional', 'Ellipse', 'Length'],
// },
// ]);
},
layoutTemplate: ({ routeProps }) => {
return {