Skip to content

Commit 711a899

Browse files
authored
Merge pull request #23 from starwit/Removed_Fullscreen_Button
Removed Fullscreen Icon and all Routines
2 parents 8d4b5b5 + d1df97d commit 711a899

File tree

8 files changed

+1
-82
lines changed

8 files changed

+1
-82
lines changed

package-lock.json

Lines changed: 0 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"moment": "^2.29.4",
2323
"prop-types": "^15.8.1",
2424
"react-draggable": "^4.4.6",
25-
"react-full-screen": "^1.1.1",
2625
"react-hotkeys": "^2.0.0",
2726
"react-i18next": "^14.1.0",
2827
"react-remove-scroll": "^2.5.9",

src/Annotator/index.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export const Annotator = ({
4848
hidePrev,
4949
hideClone,
5050
hideSettings,
51-
hideFullScreen,
5251
hideSave,
5352
enabledRegionProps = ["class", "name"],
5453
userReducer
@@ -151,7 +150,6 @@ export const Annotator = ({
151150
hidePrev={hidePrev}
152151
hideClone={hideClone}
153152
hideSettings={hideSettings}
154-
hideFullScreen={hideFullScreen}
155153
hideSave={hideSave}
156154
enabledRegionProps={enabledRegionProps}
157155
/>
@@ -195,7 +193,6 @@ Annotator.propTypes = {
195193
hidePrev: PropTypes.bool,
196194
hideClone: PropTypes.bool,
197195
hideSettings: PropTypes.bool,
198-
hideFullScreen: PropTypes.bool,
199196
hideSave: PropTypes.bool,
200197
enabledRegionProps: PropTypes.arrayOf(PropTypes.string),
201198
userReducer: PropTypes.func

src/Annotator/reducers/general-reducer.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -846,13 +846,6 @@ export default (state, action) => {
846846
case "help": {
847847
return state
848848
}
849-
case "fullscreen": {
850-
return setIn(state, ["fullScreen"], true)
851-
}
852-
case "exit fullscreen":
853-
case "window": {
854-
return setIn(state, ["fullScreen"], false)
855-
}
856849
case "hotkeys": {
857850
return state
858851
}

src/MainLayout/icon-dictionary.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
faTag,
1616
faVectorSquare
1717
} from "@fortawesome/free-solid-svg-icons"
18-
import FullscreenIcon from "@mui/icons-material/Fullscreen"
1918
import AccessibilityNewIcon from "@mui/icons-material/AccessibilityNew"
2019

2120
const faStyle = { marginTop: 4, width: 16, height: 16, marginBottom: 4 }
@@ -69,8 +68,7 @@ export const iconDictionary = {
6968
"modify-allowed-area": () => (
7069
<FontAwesomeIcon style={faStyle} size="xs" fixedWidth icon={faEdit} />
7170
),
72-
"create-keypoints": AccessibilityNewIcon,
73-
window: FullscreenIcon,
71+
"create-keypoints": AccessibilityNewIcon
7472
}
7573

7674
export default iconDictionary

src/MainLayout/index.jsx

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @flow
22

3-
import {FullScreen, useFullScreenHandle} from "react-full-screen"
43
import React, {useCallback, useRef} from "react"
54
import {createTheme, styled, ThemeProvider} from "@mui/material/styles"
65

@@ -24,7 +23,6 @@ import {useSettings} from "../SettingsProvider"
2423
import {withHotKeys} from "react-hotkeys"
2524
import {Save} from "@mui/icons-material"
2625

27-
// import Fullscreen from "../Fullscreen"
2826

2927
const emptyArr = []
3028
const theme = createTheme()
@@ -35,15 +33,6 @@ const HotkeyDiv = withHotKeys(({hotKeys, children, divRef, ...props}) => (
3533
</div>
3634
))
3735

38-
const FullScreenContainer = styled("div")(({theme}) => ({
39-
width: "100%",
40-
height: "100%",
41-
"& .fullscreen": {
42-
width: "100%",
43-
height: "100%",
44-
},
45-
}))
46-
4736
export const MainLayout = ({
4837
state,
4938
dispatch,
@@ -55,12 +44,10 @@ export const MainLayout = ({
5544
hidePrev = false,
5645
hideClone = false,
5746
hideSettings = false,
58-
hideFullScreen = false,
5947
hideSave = false,
6048
enabledRegionProps,
6149
}) => {
6250
const settings = useSettings()
63-
const fullScreenHandle = useFullScreenHandle()
6451

6552
const memoizedActionFns = useRef({})
6653
const action = (type, ...params) => {
@@ -179,44 +166,25 @@ export const MainLayout = ({
179166
enabledRegionProps={enabledRegionProps}
180167
/>
181168
)
182-
183169
const onClickHeaderItem = useEventCallback((item) => {
184-
if (item.name === "Fullscreen") {
185-
fullScreenHandle.enter()
186-
} else if (item.name === "Window") {
187-
fullScreenHandle.exit()
188-
}
189170
dispatch({type: "HEADER_BUTTON_CLICKED", buttonName: item.name})
190171
})
191-
192172
const debugModeOn = Boolean(window.localStorage.$ANNOTATE_DEBUG_MODE && state)
193173
const nextImageHasRegions =
194174
!nextImage || (nextImage.regions && nextImage.regions.length > 0)
195175

196176
return (
197177
<ThemeProvider theme={theme}>
198-
<FullScreenContainer>
199-
<FullScreen
200-
handle={fullScreenHandle}
201-
onChange={(open) => {
202-
if (!open) {
203-
fullScreenHandle.exit()
204-
action("HEADER_BUTTON_CLICKED", "buttonName")("Window")
205-
}
206-
}}
207-
>
208178
<HotkeyDiv
209179
tabIndex={-1}
210180
divRef={innerContainerRef}
211181
onMouseDown={refocusOnMouseEvent}
212182
onMouseOver={refocusOnMouseEvent}
213183
allowChanges
214184
handlers={hotkeyHandlers}
215-
className={state.fullScreen ? "Fullscreen" : ""}
216185
style={styles.container}
217186
>
218187
<Workspace
219-
allowFullscreen
220188
iconDictionary={iconDictionary}
221189
hideHeader={hideHeader}
222190
hideHeaderText={hideHeaderText}
@@ -245,10 +213,6 @@ export const MainLayout = ({
245213
!nextImageHasRegions &&
246214
activeImage.regions && {name: "Clone"},
247215
!hideSettings && {name: "Settings"},
248-
!hideFullScreen &&
249-
(state.fullScreen
250-
? {name: "Window"}
251-
: {name: "Fullscreen"}),
252216
!hideSave && {name: "Save", icon: <Save />},
253217
].filter(Boolean)}
254218
onClickHeaderItem={onClickHeaderItem}
@@ -310,8 +274,6 @@ export const MainLayout = ({
310274
{canvas}
311275
</Workspace>
312276
</HotkeyDiv>
313-
</FullScreen>
314-
</FullScreenContainer>
315277
</ThemeProvider>
316278
)
317279
}

src/MainLayout/styles.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ export default {
99
maxHeight: "100vh",
1010
backgroundColor: "#fff",
1111
overflow: "hidden",
12-
"&.fullscreen": {
13-
position: "absolute",
14-
zIndex: 99999,
15-
left: 0,
16-
right: 0,
17-
top: 0,
18-
bottom: 0,
19-
},
2012
},
2113
headerTitle: {
2214
fontWeight: "bold",

src/workspace/icon-mapping.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import PlayIcon from "@mui/icons-material/PlayArrow"
44
import PauseIcon from "@mui/icons-material/Pause"
55
import SettingsIcon from "@mui/icons-material/Settings"
66
import HelpIcon from "@mui/icons-material/Help"
7-
import FullscreenIcon from "@mui/icons-material/Fullscreen"
87
import ExitIcon from "@mui/icons-material/ExitToApp"
98
import QueuePlayNextIcon from "@mui/icons-material/QueuePlayNext"
109
import HotkeysIcon from "@mui/icons-material/Keyboard"
@@ -20,7 +19,6 @@ export const iconMapping = {
2019
settings: SettingsIcon,
2120
options: SettingsIcon,
2221
help: HelpIcon,
23-
fullscreen: FullscreenIcon,
2422
exit: ExitIcon,
2523
quit: ExitIcon,
2624
save: ExitIcon,

0 commit comments

Comments
 (0)