-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ViewportActionBar and CinePlayer): Add new design for action bar…
… and cine player (#3204) * feat(ViewportActionBar): OHIF issue #3123 (#3186) * feat(ViewportActionBar): OHIF issue #3123 - Renamed previous viewport action bar to be LegacyViewportActionBar - Components LegacyViewportActionBar depends on also renamed: LegacyCinePlayer and LegacyPatientInfo - New Viewport coded to specs in issue - added React hook useResizeObserver - added some tailwind classes * Updated tailwind to 3.2.7. Put external imports like React at the top of the import list. * feat(CinePlayer and ViewportActionBar) (#3198) * feat(CinePlayer and ViewportActionBar) - OHIF issue 3123 - new look cine control implemented - new custom blue color in tailwind config for various hover backgrounds in the cine control - new icons added for cine - Tooltip component now can be placed top (center) on hover - Tooltip component border colour now consistent with specs - fixed NPE in ViewportActionBar - upgraded tailwind to 3.2.7 in platform/ui - fixed issues in various button components brought by tailwind 3.2.7 where classes now need important flag - fixed issue with InputRange component so that the tracked value property can change externally - InputRange component can now optionally show its label - added new measurement tracking state service to hydrate SR without prompting - segmentation can also now be hydrated without prompting * PR feedback: - cine centralized to OHIFCornerstoneViewport - introduced a type for the CinePlayer properties * Addressed PR comments and concerns... The DOM ref for the root component of the ViewportActionBar is now added to state so that the various callbacks and ResizeObserver are updated with it. The CinePlayer FPS slider tooltip was moved up so that its arrow does not intersect the FPS text. The hover area for the CinePlayer slider tooltip is now the FPS < > buttons and text. The tracked measurements are now filtered to only include those of the active viewport series when the tracked measurement navigation arrows are used. * Addressed PR comments... The update to tailwind 3.2.7 caused several look-and-feel, UI regressions, so we are rolling back to 3.2.4.
- Loading branch information
Showing
55 changed files
with
1,204 additions
and
512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 26 additions & 62 deletions
88
extensions/cornerstone-dicom-seg/src/viewports/_getStatusComponent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,56 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Icon, Tooltip } from '@ohif/ui'; | ||
|
||
import _hydrateSEGDisplaySet from '../utils/_hydrateSEG'; | ||
|
||
export default function _getStatusComponent({ isHydrated, onPillClick }) { | ||
export default function _getStatusComponent({ isHydrated, onStatusClick }) { | ||
let ToolTipMessage = null; | ||
let StatusIcon = null; | ||
|
||
const {t} = useTranslation("Common"); | ||
const loadStr = t("LOAD"); | ||
|
||
switch (isHydrated) { | ||
case true: | ||
StatusIcon = () => ( | ||
<div | ||
className="flex items-center justify-center -mr-1 rounded-full" | ||
style={{ | ||
width: '18px', | ||
height: '18px', | ||
backgroundColor: '#98e5c1', | ||
border: 'solid 1.5px #000000', | ||
}} | ||
> | ||
<Icon | ||
name="exclamation" | ||
style={{ color: '#000', width: '12px', height: '12px' }} | ||
/> | ||
</div> | ||
); | ||
StatusIcon = () => <Icon name="status-alert" />; | ||
|
||
ToolTipMessage = () => ( | ||
<div>This Segmentation is loaded in the segmentation panel</div> | ||
); | ||
break; | ||
case false: | ||
StatusIcon = () => ( | ||
<div | ||
className="flex items-center justify-center -mr-1 bg-white rounded-full group-hover:bg-customblue-200" | ||
style={{ | ||
width: '18px', | ||
height: '18px', | ||
border: 'solid 1.5px #000000', | ||
}} | ||
> | ||
<Icon | ||
name="arrow-left" | ||
style={{ color: '#000', width: '14px', height: '14px' }} | ||
/> | ||
</div> | ||
); | ||
case false: | ||
StatusIcon = () => <Icon name="status-untracked" />; | ||
|
||
ToolTipMessage = () => <div>Click to load segmentation.</div>; | ||
ToolTipMessage = () => <div>Click LOAD to load segmentation.</div>; | ||
} | ||
|
||
const StatusPill = () => ( | ||
<div | ||
className={classNames( | ||
'group relative flex items-center justify-center px-8 rounded-full cursor-default bg-customgreen-100', | ||
{ | ||
'hover:bg-customblue-100': !isHydrated, | ||
'cursor-pointer': !isHydrated, | ||
} | ||
)} | ||
style={{ | ||
height: '24px', | ||
width: '55px', | ||
}} | ||
onClick={() => { | ||
if (!isHydrated) { | ||
if (onPillClick) { | ||
onPillClick(); | ||
} | ||
} | ||
}} | ||
> | ||
<div className="pr-1 text-base font-medium leading-none text-black"> | ||
SEG | ||
const StatusArea = () => ( | ||
<div className="flex h-6 leading-6 cursor-default text-sm text-white"> | ||
<div className="min-w-[45px] flex items-center p-1 rounded-l-xl rounded-r bg-customgray-100"> | ||
<StatusIcon /> | ||
<span className="ml-1">SEG</span> | ||
</div> | ||
<StatusIcon /> | ||
{!isHydrated && ( | ||
<div | ||
className="ml-1 px-1.5 rounded cursor-pointer hover:text-black bg-primary-main hover:bg-primary-light" | ||
// Using onMouseUp here because onClick is not working when the viewport is not active and is styled with pointer-events:none | ||
onMouseUp={onStatusClick} | ||
> | ||
{loadStr} | ||
</div> | ||
)} | ||
</div> | ||
); | ||
|
||
|
||
return ( | ||
<> | ||
{ToolTipMessage && ( | ||
<Tooltip content={<ToolTipMessage />} position="bottom-left"> | ||
<StatusPill /> | ||
<StatusArea /> | ||
</Tooltip> | ||
)} | ||
{!ToolTipMessage && <StatusPill />} | ||
{!ToolTipMessage && <StatusArea />} | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.