* Update all the icons * Turn off global tool sync; watch as the world burns * Shift a bunch of things around so we can start tracking/setting per element * ToolBarService to initiate one of three different calls; callback passed to all button types * SplitButton and Toolbar Button to use new `onInteraction` prop and new toolbar state * Changes to toolbar button interface and config * Fix broken layout selector * Update SR viewport to activate tools in viewport component * Duplicate activation logic in measurement tracking extension * Add alternative/dashed variants for SR Viewport * pass through "setToolActive" commands for other viewport types * fix small overlay bugs (no wwwc or scale info) * Show SpacingBetweenSlices instead of PixelSpacing in patient information dialog * Fix prop-types * Update tracked viewport to have alternative tracked styling * alt styling for SR viewports * Update to support isLocked + isRehydratable * fix broken logic * fix broken logic * switch icon style * fix icon styles * hover and click to start flow * expedited workflow when data is not dirty (just after SR hydration) * fix: setting elliptical roi tool * fix arrow annotate dialog * fix: do not show learn more button for now * remove dead code * simpler cache invalidation * simpler cache invalidation part 2 * Fix for unable to spand study cards on separate pages
62 lines
1.8 KiB
JavaScript
62 lines
1.8 KiB
JavaScript
import { ToolbarButton } from '@ohif/ui';
|
|
import ToolbarDivider from './Toolbar/ToolbarDivider.jsx';
|
|
import ToolbarLayoutSelector from './Toolbar/ToolbarLayoutSelector.jsx';
|
|
import ToolbarSplitButton from './Toolbar/ToolbarSplitButton.jsx';
|
|
|
|
export default function getToolbarModule({ commandsManager, servicesManager }) {
|
|
const toolbarService = servicesManager.services.ToolBarService;
|
|
|
|
return [
|
|
{
|
|
name: 'ohif.divider',
|
|
defaultComponent: ToolbarDivider,
|
|
clickHandler: () => {},
|
|
},
|
|
{
|
|
name: 'ohif.action',
|
|
defaultComponent: ToolbarButton,
|
|
clickHandler: () => {},
|
|
},
|
|
{
|
|
name: 'ohif.radioGroup',
|
|
defaultComponent: ToolbarButton,
|
|
clickHandler: () => {},
|
|
},
|
|
{
|
|
name: 'ohif.splitButton',
|
|
defaultComponent: ToolbarSplitButton,
|
|
clickHandler: () => {},
|
|
},
|
|
{
|
|
name: 'ohif.layoutSelector',
|
|
defaultComponent: ToolbarLayoutSelector,
|
|
clickHandler: (evt, clickedBtn, btnSectionName) => {},
|
|
},
|
|
{
|
|
name: 'ohif.toggle',
|
|
defaultComponent: ToolbarButton,
|
|
requiredConfig: [],
|
|
optionalConfig: [],
|
|
requiredProps: [],
|
|
optionalProps: [],
|
|
clickHandler: (evt, clickedBtn, btnSectionName) => {
|
|
const { props } = clickedBtn;
|
|
const allButtons = toolbarService.getButtons();
|
|
const thisButton = allButtons[clickedBtn.id];
|
|
|
|
// Set our clicked button to active
|
|
thisButton.props.isActive = !thisButton.props.isActive;
|
|
|
|
// Run button logic/command
|
|
commandsManager.runCommand(props.commandName, props.commandOptions);
|
|
|
|
// What if just toggled "content"?
|
|
// commandName OR content?
|
|
|
|
// Set buttons & trigger notification
|
|
toolbarService.setButtons(allButtons);
|
|
},
|
|
},
|
|
];
|
|
}
|