diff --git a/OHIFViewer/client/components/flexboxLayout/flexboxLayout.styl b/OHIFViewer/client/components/flexboxLayout/flexboxLayout.styl index fe7a544d5..1fa946856 100644 --- a/OHIFViewer/client/components/flexboxLayout/flexboxLayout.styl +++ b/OHIFViewer/client/components/flexboxLayout/flexboxLayout.styl @@ -7,7 +7,7 @@ $lesionsSidebarMenuWidth = 450px flex: 1 flex-flow: row nowrap align-items: stretch - height: calc(100% - 78px); + height: 'calc(100% - %s)' %toolbarHeight; width: 100% .sidebarMenu diff --git a/OHIFViewer/client/components/toolbarSection/toolbarSection.html b/OHIFViewer/client/components/toolbarSection/toolbarSection.html new file mode 100644 index 000000000..180b0ab27 --- /dev/null +++ b/OHIFViewer/client/components/toolbarSection/toolbarSection.html @@ -0,0 +1,13 @@ + + + diff --git a/OHIFViewer/client/components/toolbarSection/toolbarSection.js b/OHIFViewer/client/components/toolbarSection/toolbarSection.js new file mode 100644 index 000000000..dacb706d5 --- /dev/null +++ b/OHIFViewer/client/components/toolbarSection/toolbarSection.js @@ -0,0 +1,170 @@ +import { OHIF } from 'meteor/ohif:core'; + +Template.toolbarSection.helpers({ + leftSidebarToggleButtonData() { + const instance = Template.instance(); + return { + toggleable: true, + key: 'leftSidebar', + value: instance.data.state, + options: [{ + value: 'studies', + svgLink: '/packages/viewerbase/assets/icons.svg#icon-studies', + svgWidth: 15, + svgHeight: 13, + bottomLabel: 'Studies' + }] + }; + }, + + rightSidebarToggleButtonData() { + const instance = Template.instance(); + return { + toggleable: true, + key: 'rightSidebar', + value: instance.data.state, + options: [{ + value: 'hangingprotocols', + iconClasses: 'fa fa-cog', + bottomLabel: 'Hanging' + }] + }; + }, + + toolbarButtons() { + var buttonData = []; + buttonData.push({ + id: 'zoom', + title: 'Zoom', + classes: 'imageViewerTool', + svgLink: '/packages/viewerbase/assets/icons.svg#icon-tools-zoom' + }); + + buttonData.push({ + id: 'wwwc', + title: 'Levels', + classes: 'imageViewerTool', + svgLink: '/packages/viewerbase/assets/icons.svg#icon-tools-levels' + }); + + buttonData.push({ + id: 'pan', + title: 'Pan', + classes: 'imageViewerTool', + svgLink: '/packages/viewerbase/assets/icons.svg#icon-tools-pan' + }); + + buttonData.push({ + id: 'length', + title: 'Length', + classes: 'imageViewerTool toolbarSectionButton', + svgLink: '/packages/viewerbase/assets/icons.svg#icon-tools-measure-temp' + }); + + buttonData.push({ + id: 'annotate', + title: 'Annotate', + classes: 'imageViewerTool', + svgLink: '/packages/viewerbase/assets/icons.svg#icon-tools-measure-non-target' + }); + + buttonData.push({ + id: 'angle', + title: 'Angle', + classes: 'imageViewerTool', + iconClasses: 'fa fa-angle-left' + }); + + buttonData.push({ + id: 'resetViewport', + title: 'Reset', + classes: 'imageViewerCommand', + iconClasses: 'fa fa-undo' + }); + + return buttonData; + }, + + extraToolbarButtons() { + let buttonData = []; + + buttonData.push({ + id: 'stackScroll', + title: 'Stack Scroll', + classes: 'imageViewerTool', + iconClasses: 'fa fa-bars' + }); + + buttonData.push({ + id: 'magnify', + title: 'Magnify', + classes: 'imageViewerTool toolbarSectionButton', + iconClasses: 'fa fa-circle' + }); + + buttonData.push({ + id: 'wwwcRegion', + title: 'ROI Window', + classes: 'imageViewerTool', + iconClasses: 'fa fa-square' + }); + + buttonData.push({ + id: 'dragProbe', + title: 'Probe', + classes: 'imageViewerTool', + iconClasses: 'fa fa-dot-circle-o' + }); + + buttonData.push({ + id: 'ellipticalRoi', + title: 'Ellipse', + classes: 'imageViewerTool', + iconClasses: 'fa fa-circle-o' + }); + + buttonData.push({ + id: 'rectangleRoi', + title: 'Rectangle', + classes: 'imageViewerTool', + iconClasses: 'fa fa-square-o' + }); + + buttonData.push({ + id: 'invert', + title: 'Invert', + classes: 'imageViewerCommand', + iconClasses: 'fa fa-adjust' + }); + + buttonData.push({ + id: 'clearTools', + title: 'Clear', + classes: 'imageViewerCommand', + iconClasses: 'fa fa-trash' + }); + + return buttonData; + } + +}); + +Template.toolbarSection.onRendered(function() { + const instance = Template.instance(); + + // Set disabled/enabled tool buttons that are set in toolManager + const states = toolManager.getToolDefaultStates(); + const disabledToolButtons = states.disabledToolButtons; + const allToolbarButtons = $('#toolbar').find('button'); + if (disabledToolButtons && disabledToolButtons.length > 0) { + for (var i = 0; i < allToolbarButtons.length; i++) { + const toolbarButton = allToolbarButtons[i]; + $(toolbarButton).prop('disabled', false); + + const index = disabledToolButtons.indexOf($(toolbarButton).attr('id')); + if (index !== -1) { + $(toolbarButton).prop('disabled', true); + } + } + } +}); diff --git a/OHIFViewer/client/components/toolbarSection/toolbarSection.styl b/OHIFViewer/client/components/toolbarSection/toolbarSection.styl new file mode 100644 index 000000000..886b938e2 --- /dev/null +++ b/OHIFViewer/client/components/toolbarSection/toolbarSection.styl @@ -0,0 +1,14 @@ +@import "{design}/app" + +.toolbarSection + border-bottom: $uiBorderColor $uiBorderThickness solid + flex: 0 0 auto + height: $toolbarHeight + overflow: hidden + padding-top: 6px + position: relative + transition(height 300ms ease) + width: 100% + + &.expanded + height: $toolbarHeight + $toolbarDrawerHeight \ No newline at end of file diff --git a/OHIFViewer/client/components/viewer/viewer.html b/OHIFViewer/client/components/viewer/viewer.html index 533f1bd50..b8086484c 100644 --- a/OHIFViewer/client/components/viewer/viewer.html +++ b/OHIFViewer/client/components/viewer/viewer.html @@ -4,21 +4,7 @@ {{> cineDialog}}