From 609f0bd1e4be3b68ebfe188bc0ce2e46c4248500 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Thu, 26 Mar 2020 23:18:36 +0300 Subject: [PATCH] Titles in attribute annotations mode --- .../attribute-annotation-sidebar.tsx | 2 ++ .../attribute-switcher.tsx | 21 +++++++++++++------ .../object-switcher.tsx | 21 +++++++++++++------ 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/cvat-ui/src/components/annotation-page/attribute-annotation-workspace/attribute-annotation-sidebar/attribute-annotation-sidebar.tsx b/cvat-ui/src/components/annotation-page/attribute-annotation-workspace/attribute-annotation-sidebar/attribute-annotation-sidebar.tsx index 6057a199..9396ad5d 100644 --- a/cvat-ui/src/components/annotation-page/attribute-annotation-workspace/attribute-annotation-sidebar/attribute-annotation-sidebar.tsx +++ b/cvat-ui/src/components/annotation-page/attribute-annotation-workspace/attribute-annotation-sidebar/attribute-annotation-sidebar.tsx @@ -226,6 +226,7 @@ function AttributeAnnotationSidebar(props: StateToProps & DispatchToProps): JSX. occluded={activeObjectState.occluded} objectsCount={states.length} currentIndex={states.indexOf(activeObjectState)} + keyMap={keyMap} nextObject={nextObject} /> ; nextAttribute(step: number): void; } @@ -21,21 +25,26 @@ function AttributeSwitcher(props: Props): JSX.Element { currentIndex, attributesCount, nextAttribute, + keyMap, } = props; const title = `${currentAttribute} [${currentIndex + 1}/${attributesCount}]`; return (
- + + + {currentAttribute} {` [${currentIndex + 1}/${attributesCount}]`} - + + +
); } diff --git a/cvat-ui/src/components/annotation-page/attribute-annotation-workspace/attribute-annotation-sidebar/object-switcher.tsx b/cvat-ui/src/components/annotation-page/attribute-annotation-workspace/attribute-annotation-sidebar/object-switcher.tsx index 9341396f..a796a933 100644 --- a/cvat-ui/src/components/annotation-page/attribute-annotation-workspace/attribute-annotation-sidebar/object-switcher.tsx +++ b/cvat-ui/src/components/annotation-page/attribute-annotation-workspace/attribute-annotation-sidebar/object-switcher.tsx @@ -3,17 +3,21 @@ // SPDX-License-Identifier: MIT import React from 'react'; +import { ExtendedKeyMapOptions } from 'react-hotkeys'; import Icon from 'antd/lib/icon'; import Text from 'antd/lib/typography/Text'; import Tooltip from 'antd/lib/tooltip'; import Button from 'antd/lib/button'; +import { formatShortcuts } from 'utils/shortcuts'; + interface Props { currentLabel: string; clientID: number; occluded: boolean; objectsCount: number; currentIndex: number; + keyMap: Record; nextObject(step: number): void; } @@ -24,23 +28,28 @@ function ObjectSwitcher(props: Props): JSX.Element { objectsCount, currentIndex, nextObject, + keyMap, } = props; const title = `${currentLabel} ${clientID} [${currentIndex + 1}/${objectsCount}]`; return (
- + + + {currentLabel} {` ${clientID} `} {`[${currentIndex + 1}/${objectsCount}]`} - + + +
); }