[OHIF-251] - Double click to maximise viewport/ revert to previous layout. (#1860)
* WIP * double click to maximise implemented at the viewport grid layer. * Remove memory of cached layout when the layout is changed, or a different displaySet is set. * WIP fix double click for cornerstone. * Update CST * Prevent maximising when double clicking the action bar * Update extensions/dicom-sr/src/OHIFCornerstoneSRViewport.js * Apply suggestions from code review * Fix conflicts. Co-authored-by: Danny Brown <danny.ri.brown@gmail.com>
This commit is contained in:
1 parent
5ee4598bbe
commit
4dfe144bf8
18 files changed
+178
-40
No files matched your search
@@ -399,14 +399,23 @@ function OHIFCornerstoneSRViewport({
|
||||
});
|
||||
}
|
||||
|
||||
const label =
|
||||
viewports.length > 1
|
||||
? _viewportLabels[firstViewportIndexWithMatchingDisplaySetUid]
|
||||
: '';
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewportActionBar
|
||||
onDoubleClick={evt => {
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
}}
|
||||
onSeriesChange={onMeasurementChange}
|
||||
onHydrationClick={hydrateMeasurementService}
|
||||
showNavArrows={viewportIndex === activeViewportIndex}
|
||||
studyData={{
|
||||
label: _viewportLabels[firstViewportIndexWithMatchingDisplaySetUid],
|
||||
label,
|
||||
isTracked: false,
|
||||
isLocked: displaySet.isLocked,
|
||||
isHydrated,
|
||||
@@ -432,18 +441,23 @@ function OHIFCornerstoneSRViewport({
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<CornerstoneViewport
|
||||
onElementEnabled={onElementEnabled}
|
||||
viewportIndex={viewportIndex}
|
||||
imageIds={imageIds}
|
||||
imageIdIndex={currentImageIdIndex}
|
||||
// TODO: ViewportGrid Context?
|
||||
isActive={true} // todo
|
||||
isStackPrefetchEnabled={true} // todo
|
||||
isPlaying={false}
|
||||
frameRate={24}
|
||||
isOverlayVisible={false}
|
||||
/>
|
||||
<div
|
||||
className="relative flex flex-row w-full h-full"
|
||||
onDoubleClick={_onDoubleClick}
|
||||
>
|
||||
<CornerstoneViewport
|
||||
onElementEnabled={onElementEnabled}
|
||||
viewportIndex={viewportIndex}
|
||||
imageIds={imageIds}
|
||||
imageIdIndex={currentImageIdIndex}
|
||||
// TODO: ViewportGrid Context?
|
||||
isActive={true} // todo
|
||||
isStackPrefetchEnabled={true} // todo
|
||||
isPlaying={false}
|
||||
frameRate={24}
|
||||
isOverlayVisible={false}
|
||||
/>
|
||||
</div>
|
||||
{childrenWithProps}
|
||||
</>
|
||||
);
|
||||
@@ -573,4 +587,14 @@ function _addToolDataToCornerstoneTools(data, toolType, imageId) {
|
||||
toolData.data.push(data);
|
||||
}
|
||||
|
||||
function _onDoubleClick() {
|
||||
const cancelActiveManipulatorsForElement = cornerstoneTools.getModule(
|
||||
'manipulatorState'
|
||||
).setters.cancelActiveManipulatorsForElement;
|
||||
const enabledElements = cornerstoneTools.store.state.enabledElements;
|
||||
enabledElements.forEach(element => {
|
||||
cancelActiveManipulatorsForElement(element);
|
||||
});
|
||||
}
|
||||
|
||||
export default OHIFCornerstoneSRViewport;
|
||||
Reference in new issue
Block a user