Skip to content

Commit

Permalink
segment id and name in one line
Browse files Browse the repository at this point in the history
  • Loading branch information
dieknolle3333 committed Jul 10, 2024
1 parent 6bf278a commit d4cbde4
Showing 1 changed file with 27 additions and 23 deletions.
50 changes: 27 additions & 23 deletions frontend/javascripts/oxalis/view/context_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1652,16 +1652,16 @@ function ContextMenuInner(propsWithInputRef: Props) {
}

if (wasSegmentOrMeshClicked) {
infoRows.push(
getInfoMenuItem(
"copy-cell",
<>
<div className="cell-context-icon" />
Segment ID: {`${clickedSegmentOrMeshId}`}{" "}
{copyIconWithTooltip(clickedSegmentOrMeshId, "Copy Segment ID")}
</>,
),
);
/* infoRows.push(
getInfoMenuItem(
"copy-cell",
<>
<div className="cell-context-icon" />
Segment ID: {`${clickedSegmentOrMeshId}`}{" "}
{copyIconWithTooltip(clickedSegmentOrMeshId, "Copy Segment ID")}
</>,
),
); */
}
if (segments != null) {
const segmentName = segments.getNullable(clickedSegmentOrMeshId)?.name;
Expand All @@ -1672,20 +1672,24 @@ function ContextMenuInner(propsWithInputRef: Props) {
getInfoMenuItem(
"copy-cell",
<>
<i className="fas fa-tag segment-context-icon" />
<Tooltip title={segmentName.length > maxNameLengthSecondLine ? segmentName : null}>
Segment Name:{" "}
{segmentName.length < maxNameLengthFirstLine &&
truncateStringToLength(segmentName, maxNameLengthFirstLine)}
{segmentName.length < maxNameLengthFirstLine &&
copyIconWithTooltip(segmentName, "Copy Segment Name")}
<div style={{ marginLeft: 22, marginTop: -5 }}>
{segmentName.length > maxNameLengthFirstLine &&
truncateStringToLength(segmentName, maxNameLengthSecondLine)}
{segmentName.length > maxNameLengthFirstLine &&
<div className="cell-context-icon" />
Segment ID: {`${clickedSegmentOrMeshId}`}{" "}
{copyIconWithTooltip(clickedSegmentOrMeshId, "Copy Segment ID")}
<div style={{ marginLeft: 22, marginTop: -5 }}>
<Tooltip title={segmentName.length > maxNameLengthSecondLine ? segmentName : null}>
Segment Name:{" "}
{segmentName.length < maxNameLengthFirstLine &&
truncateStringToLength(segmentName, maxNameLengthFirstLine)}
{segmentName.length < maxNameLengthFirstLine &&
copyIconWithTooltip(segmentName, "Copy Segment Name")}
</div>
</Tooltip>
<div style={{ marginTop: -5 }}>
{segmentName.length > maxNameLengthFirstLine &&
truncateStringToLength(segmentName, maxNameLengthSecondLine)}
{segmentName.length > maxNameLengthFirstLine &&
copyIconWithTooltip(segmentName, "Copy Segment Name")}
</div>
</Tooltip>
</div>
</>,
),
);
Expand Down

0 comments on commit d4cbde4

Please sign in to comment.