|
1 | 1 | // @flow
|
2 | 2 |
|
3 |
| -import React, { useRef, useCallback } from "react" |
4 |
| -import type { Node } from "react" |
| 3 | +import type { Action, MainLayoutState } from "./types" |
| 4 | +import { FullScreen, useFullScreenHandle } from "react-full-screen" |
| 5 | +import React, { useCallback, useRef } from "react" |
5 | 6 | import { makeStyles, styled } from "@material-ui/core/styles"
|
| 7 | + |
| 8 | +import ClassSelectionMenu from "../ClassSelectionMenu" |
| 9 | +import DebugBox from "../DebugSidebarBox" |
| 10 | +import HistorySidebarBox from "../HistorySidebarBox" |
6 | 11 | import ImageCanvas from "../ImageCanvas"
|
7 |
| -import styles from "./styles" |
8 |
| -import type { MainLayoutState, Action } from "./types" |
9 |
| -import useKey from "use-key-hook" |
10 |
| -import classnames from "classnames" |
11 |
| -import { useSettings } from "../SettingsProvider" |
12 |
| -import SettingsDialog from "../SettingsDialog" |
13 |
| -// import Fullscreen from "../Fullscreen" |
14 |
| -import { FullScreen, useFullScreenHandle } from "react-full-screen" |
15 |
| -import getActiveImage from "../Annotator/reducers/get-active-image" |
16 |
| -import useImpliedVideoRegions from "./use-implied-video-regions" |
17 |
| -import { useDispatchHotkeyHandlers } from "../ShortcutsManager" |
18 |
| -import { withHotKeys } from "react-hotkeys" |
19 |
| -import iconDictionary from "./icon-dictionary" |
| 12 | +import ImageSelector from "../ImageSelectorSidebarBox" |
20 | 13 | import KeyframeTimeline from "../KeyframeTimeline"
|
21 |
| -import Workspace from "react-material-workspace-layout/Workspace" |
22 |
| -import DebugBox from "../DebugSidebarBox" |
23 |
| -import TagsSidebarBox from "../TagsSidebarBox" |
24 | 14 | import KeyframesSelector from "../KeyframesSelectorSidebarBox"
|
25 |
| -import TaskDescription from "../TaskDescriptionSidebarBox" |
| 15 | +import type { Node } from "react" |
26 | 16 | import RegionSelector from "../RegionSelectorSidebarBox"
|
27 |
| -import ImageSelector from "../ImageSelectorSidebarBox" |
28 |
| -import HistorySidebarBox from "../HistorySidebarBox" |
29 |
| -import useEventCallback from "use-event-callback" |
| 17 | +import SettingsDialog from "../SettingsDialog" |
| 18 | +import TagsSidebarBox from "../TagsSidebarBox" |
| 19 | +import TaskDescription from "../TaskDescriptionSidebarBox" |
| 20 | +import Workspace from "react-material-workspace-layout/Workspace" |
| 21 | +import classnames from "classnames" |
| 22 | +import getActiveImage from "../Annotator/reducers/get-active-image" |
30 | 23 | import getHotkeyHelpText from "../utils/get-hotkey-help-text"
|
31 |
| -import ClassSelectionMenu from "../ClassSelectionMenu" |
| 24 | +import iconDictionary from "./icon-dictionary" |
| 25 | +import styles from "./styles" |
| 26 | +import { useDispatchHotkeyHandlers } from "../ShortcutsManager" |
| 27 | +import useEventCallback from "use-event-callback" |
| 28 | +import useImpliedVideoRegions from "./use-implied-video-regions" |
| 29 | +import useKey from "use-key-hook" |
| 30 | +import { useSettings } from "../SettingsProvider" |
| 31 | +import { withHotKeys } from "react-hotkeys" |
| 32 | + |
| 33 | +// import Fullscreen from "../Fullscreen" |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
32 | 52 |
|
33 | 53 | const emptyArr = []
|
34 | 54 | const useStyles = makeStyles(styles)
|
@@ -70,6 +90,10 @@ export const MainLayout = ({
|
70 | 90 | hideHeaderText,
|
71 | 91 | hideNext = false,
|
72 | 92 | hidePrev = false,
|
| 93 | + hideClone = false, |
| 94 | + hideSettings = false, |
| 95 | + hideFullScreen = false, |
| 96 | + hideSave = false |
73 | 97 | }: Props) => {
|
74 | 98 | const classes = useStyles()
|
75 | 99 | const settings = useSettings()
|
@@ -256,10 +280,10 @@ export const MainLayout = ({
|
256 | 280 | : !state.videoPlaying
|
257 | 281 | ? { name: "Play" }
|
258 | 282 | : { name: "Pause" },
|
259 |
| - !nextImageHasRegions && activeImage.regions && { name: "Clone" }, |
260 |
| - { name: "Settings" }, |
261 |
| - state.fullScreen ? { name: "Window" } : { name: "Fullscreen" }, |
262 |
| - { name: "Save" }, |
| 283 | + !hideClone && !nextImageHasRegions && activeImage.regions && { name: "Clone" }, |
| 284 | + !hideSettings && { name: "Settings" }, |
| 285 | + !hideFullScreen && (state.fullScreen ? { name: "Window" } : { name: "Fullscreen" }), |
| 286 | + !hideSave && { name: "Save" }, |
263 | 287 | ].filter(Boolean)}
|
264 | 288 | onClickHeaderItem={onClickHeaderItem}
|
265 | 289 | onClickIconSidebarItem={onClickIconSidebarItem}
|
|
0 commit comments