Skip to content

Commit

Permalink
disable segment color change in dataset view mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dieknolle3333 committed Sep 26, 2023
1 parent 5dd346e commit 157d069
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import Toast from "libs/toast";
import _, { isNumber } from "lodash";
import memoizeOne from "memoize-one";
import type { Vector3 } from "oxalis/constants";
import { MappingStatusEnum } from "oxalis/constants";
import { ControlModeEnum, MappingStatusEnum } from "oxalis/constants";
import { getSegmentIdForPosition } from "oxalis/controller/combinations/volume_handlers";
import {
getMappingInfo,
Expand Down Expand Up @@ -129,6 +129,7 @@ const segmentsTabId = "segment-list";
type StateProps = {
isosurfaces: Record<number, IsosurfaceInformation>;
dataset: APIDataset;
isDatasetViewMode: boolean;
isJSONMappingEnabled: boolean;
mappingInfo: ActiveMappingInfo;
flycam: Flycam;
Expand Down Expand Up @@ -169,6 +170,7 @@ const mapStateToProps = (state: OxalisState): StateProps => {
? state.localSegmentationData[visibleSegmentationLayer.name].isosurfaces
: EMPTY_OBJECT,
dataset: state.dataset,
isDatasetViewMode: state.temporaryConfiguration.controlMode === ControlModeEnum.VIEW,
isJSONMappingEnabled:
mappingInfo.mappingStatus === MappingStatusEnum.ENABLED && mappingInfo.mappingType === "JSON",
mappingInfo,
Expand Down Expand Up @@ -952,6 +954,7 @@ class SegmentsView extends React.Component<Props, State> {
getSetGroupColorMenuItem = (groupId: number | null): ItemType => {
return {
key: "changeGroupColor",
disabled: this.props.isDatasetViewMode,
icon: (
<i
className="fas fa-eye-dropper fa-sm fa-icon fa-fw"
Expand All @@ -963,7 +966,7 @@ class SegmentsView extends React.Component<Props, State> {
label: (
<ChangeColorMenuItemContent
title="Change Segment Color"
isDisabled={false}
isDisabled={this.props.isDatasetViewMode} // changing the color is not possible in dataset view mode
onSetColor={(color) => {
if (getVisibleSegmentationLayer == null) {
return;
Expand All @@ -989,6 +992,7 @@ class SegmentsView extends React.Component<Props, State> {
}}
/>
),
disabled: this.props.isDatasetViewMode,
label: (
<div
title={title}
Expand Down Expand Up @@ -1036,7 +1040,6 @@ class SegmentsView extends React.Component<Props, State> {
};

getComputeMeshesAdHocMenuItem = (groupId: number | null): ItemType => {
// TODO currently not working
return {
key: "computeAdHoc",
icon: <i className="fas fa-dice-d20 fa-fw fa-icon" />,
Expand Down

0 comments on commit 157d069

Please sign in to comment.