Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable brush in merge mode #4770

Merged
merged 12 commits into from
Aug 19, 2020
Merged
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- In the Edit/Import Dataset form, the "Sharing" tab was renamed to "Sharing & Permissions". Also, existing permission-related settings were moved to that tab. [#4683](https://github.com/scalableminds/webknossos/pull/4763)
- Improved rotation of camera in 3D viewport. [#4768](https://github.com/scalableminds/webknossos/pull/4768)
- Improved handling and communication of failures during download of data from datasets. [#4765](https://github.com/scalableminds/webknossos/pull/4765)
- The annotation tools in hybrid tracings are disabled while in merger mode. [#4757](https://github.com/scalableminds/webknossos/pull/4770)
grittaweisheit marked this conversation as resolved.
Show resolved Hide resolved

### Fixed
- Speed up NML import in existing tracings for NMLs with many trees (20,000+). [#4742](https://github.com/scalableminds/webknossos/pull/4742)
Expand Down
26 changes: 23 additions & 3 deletions frontend/javascripts/oxalis/view/action-bar/volume_actions_view.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import { Button, Radio } from "antd";
import { Button, Radio, Tooltip } from "antd";
import { connect } from "react-redux";
import React, { PureComponent } from "react";

Expand All @@ -17,9 +17,16 @@ const ButtonGroup = Button.Group;

type Props = {|
activeTool: VolumeTool,
isInMergerMode: boolean,
|};

class VolumeActionsView extends PureComponent<Props> {
componentDidUpdate = (prevProps: Props) => {
if (!prevProps.isInMergerMode && this.props.isInMergerMode) {
Store.dispatch(setToolAction(VolumeToolEnum.MOVE));
}
};

handleSetTool = (event: { target: { value: VolumeTool } }) => {
Store.dispatch(setToolAction(event.target.value));
};
Expand All @@ -41,8 +48,20 @@ class VolumeActionsView extends PureComponent<Props> {
style={{ marginRight: 10 }}
>
<RadioButton value={VolumeToolEnum.MOVE}>Move</RadioButton>
<RadioButton value={VolumeToolEnum.TRACE}>Trace</RadioButton>
<RadioButton value={VolumeToolEnum.BRUSH}>Brush</RadioButton>
<Tooltip
title={
this.props.isInMergerMode
? "Volume annotation is disabled while the merger mode is active."
: ""
}
>
<RadioButton value={VolumeToolEnum.TRACE} disabled={this.props.isInMergerMode}>
Trace
</RadioButton>
<RadioButton value={VolumeToolEnum.BRUSH} disabled={this.props.isInMergerMode}>
Brush
</RadioButton>
</Tooltip>
</RadioGroup>
<ButtonGroup>
<ButtonComponent onClick={this.handleCreateCell}>
Expand All @@ -58,6 +77,7 @@ class VolumeActionsView extends PureComponent<Props> {
function mapStateToProps(state: OxalisState): Props {
return {
activeTool: enforceVolumeTracing(state.tracing).activeTool,
isInMergerMode: state.temporaryConfiguration.isMergerModeEnabled,
};
}

Expand Down
8 changes: 8 additions & 0 deletions frontend/stylesheets/trace_view/_tracing_view.less
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@
&:hover {
border-color: @hover-border;
}

&.ant-btn-disabled,
&.ant-input-disabled,
&.ant-radio-button-wrapper-disabled,
&.ant-select-selection-disabled {
color: fade(@dark-fg, 50%);
border-color: @dark-border;
}
}

.ant-select-arrow {
Expand Down