main
Dmitry Kalinin 6 years ago
parent c11cc642df
commit 3c128b2a73

@ -370,8 +370,8 @@ export function updateCanvasContextMenu(
visible: boolean, visible: boolean,
left: number, left: number,
top: number, top: number,
pointID: number | null = null,
type?: ContextMenuType, type?: ContextMenuType,
pointID?: number,
): AnyAction { ): AnyAction {
return { return {
type: AnnotationActionTypes.UPDATE_CANVAS_CONTEXT_MENU, type: AnnotationActionTypes.UPDATE_CANVAS_CONTEXT_MENU,

@ -5,14 +5,11 @@
import React from 'react'; import React from 'react';
import { GlobalHotKeys, KeyMap } from 'react-hotkeys'; import { GlobalHotKeys, KeyMap } from 'react-hotkeys';
import { import Tooltip from 'antd/lib/tooltip';
Layout, import Icon from 'antd/lib/icon';
Slider, import Layout from 'antd/lib/layout/layout';
Icon, import Slider, { SliderValue } from 'antd/lib/slider';
Tooltip,
} from 'antd';
import { SliderValue } from 'antd/lib/slider';
import { import {
ColorBy, ColorBy,
GridColor, GridColor,

@ -119,77 +119,3 @@
margin: 0px 5px; margin: 0px 5px;
} }
} }
.cvat-canvas-context-menu {
opacity: 0.6;
position: fixed;
width: 300px;
z-index: 10;
max-height: 50%;
overflow-y: auto;
&:hover {
opacity: 1;
}
}
.cvat-canvas-point-context-menu {
opacity: 0.6;
position: fixed;
width: 135px;
z-index: 10;
max-height: 50%;
overflow-y: auto;
background-color: #ffffff;
border-radius: 4px;
&:hover {
opacity: 1;
}
}
.cvat-canvas-z-axis-wrapper {
position: absolute;
background: $background-color-2;
bottom: 10px;
right: 10px;
height: 150px;
z-index: 100;
border-radius: 6px;
opacity: 0.5;
border: 1px solid $border-color-3;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 3px;
&:hover {
opacity: 1;
}
> .ant-slider {
height: 75%;
margin: 5px 3px;
> .ant-slider-rail {
background-color: #979797;
}
> .ant-slider-handle {
transform: none !important;
}
}
> i {
opacity: 0.7;
color: $objects-bar-icons-color;
&:hover {
opacity: 1;
}
&:active {
opacity: 0.7;
}
}
}

@ -229,6 +229,21 @@
} }
} }
.cvat-canvas-point-context-menu {
opacity: 0.6;
position: fixed;
width: 135px;
z-index: 10;
max-height: 50%;
overflow-y: auto;
background-color: #ffffff;
border-radius: 4px;
&:hover {
opacity: 1;
}
}
.cvat-canvas-z-axis-wrapper { .cvat-canvas-z-axis-wrapper {
position: absolute; position: absolute;
background: $background-color-2; background: $background-color-2;

@ -13,7 +13,7 @@ import CanvasPointContextMenuComponent from 'components/annotation-page/standard
interface StateToProps { interface StateToProps {
activatedStateID: number | null; activatedStateID: number | null;
activatedPointID: number | null | undefined; activatedPointID: number | null;
states: any[]; states: any[];
visible: boolean; visible: boolean;
top: number; top: number;
@ -70,15 +70,15 @@ function mapDispatchToProps(dispatch: any): DispatchToProps {
type Props = StateToProps & DispatchToProps; type Props = StateToProps & DispatchToProps;
interface State { interface State {
activatedStateID: number | null | undefined; activatedStateID: number | null;
activatedPointID: number | null | undefined; activatedPointID: number | null;
latestLeft: number; latestLeft: number;
latestTop: number; latestTop: number;
left: number; left: number;
top: number; top: number;
} }
class CanvasContextMenuContainer extends React.PureComponent<Props, State> { class CanvasPointContextMenuContainer extends React.PureComponent<Props, State> {
public constructor(props: Props) { public constructor(props: Props) {
super(props); super(props);
@ -190,4 +190,4 @@ class CanvasContextMenuContainer extends React.PureComponent<Props, State> {
export default connect( export default connect(
mapStateToProps, mapStateToProps,
mapDispatchToProps, mapDispatchToProps,
)(CanvasContextMenuContainer); )(CanvasPointContextMenuContainer);

@ -260,7 +260,7 @@ function mapDispatchToProps(dispatch: any): DispatchToProps {
}, },
onUpdateContextMenu(visible: boolean, left: number, top: number, onUpdateContextMenu(visible: boolean, left: number, top: number,
type: ContextMenuType, pointID?: number): void { type: ContextMenuType, pointID?: number): void {
dispatch(updateCanvasContextMenu(visible, left, top, type, pointID)); dispatch(updateCanvasContextMenu(visible, left, top, pointID, type));
}, },
onAddZLayer(): void { onAddZLayer(): void {
dispatch(addZLayer()); dispatch(addZLayer());

@ -304,7 +304,7 @@ export interface AnnotationState {
top: number; top: number;
left: number; left: number;
type: ContextMenuType; type: ContextMenuType;
pointID: number | null | undefined; pointID: number | null;
}; };
instance: Canvas; instance: Canvas;
ready: boolean; ready: boolean;

Loading…
Cancel
Save