Skip to content

Commit 1080ea7

Browse files
committed
added modify allowed area icon
1 parent 69bd601 commit 1080ea7

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

src/IconTools/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const defaultTools = [
5252
export const IconTools = ({
5353
showTags,
5454
showMask,
55+
modifyAllowedArea,
5556
selectedTool,
5657
onClickTool,
5758
enabledTools = defaultTools,
@@ -126,6 +127,13 @@ export const IconTools = ({
126127
name="Show / Hide Mask"
127128
icon={<FontAwesomeIcon size="xs" fixedWidth icon={faMask} />}
128129
/>
130+
<SmallToolButton
131+
togglable
132+
selected={modifyAllowedArea}
133+
id="modify-allowed-area"
134+
name="Modify Allowed Area"
135+
icon={<FontAwesomeIcon size="xs" fixedWidth icon={faMask} />}
136+
/>
129137
</SelectedTool.Provider>
130138
</div>
131139
)

src/MainLayout/icon-dictionary.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
faHandPaper,
1616
faSearch,
1717
faMask,
18+
faEdit,
1819
} from "@fortawesome/free-solid-svg-icons"
1920
import FullscreenIcon from "@material-ui/icons/Fullscreen"
2021

@@ -63,6 +64,9 @@ export const iconDictionary = {
6364
"show-mask": () => (
6465
<FontAwesomeIcon style={faStyle} size="xs" fixedWidth icon={faMask} />
6566
),
67+
"modify-allowed-area": () => (
68+
<FontAwesomeIcon style={faStyle} size="xs" fixedWidth icon={faEdit} />
69+
),
6670
window: FullscreenIcon,
6771
}
6872

src/MainLayout/index.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,19 +244,23 @@ export const MainLayout = ({
244244
{
245245
name: "select",
246246
helperText: "Select",
247+
alwaysShowing: true,
247248
selected: state.selectedTool,
248249
},
249250
{
250251
name: "pan",
251252
helperText: "Drag/Pan",
253+
alwaysShowing: true,
252254
},
253255
{
254256
name: "zoom",
255257
helperText: "Zoom In/Out",
258+
alwaysShowing: true,
256259
},
257260
{
258261
name: "show-tags",
259262
helperText: "Show / Hide Tags",
263+
alwaysShowing: true,
260264
},
261265
{
262266
name: "create-point",
@@ -274,11 +278,20 @@ export const MainLayout = ({
274278
name: "create-expanding-line",
275279
helperText: "Add Expanding Line",
276280
},
277-
{
281+
state.fullImageSegmentationMode && {
278282
name: "show-mask",
283+
alwaysShowing: true,
279284
helperText: "Show / Hide Mask",
280285
},
281-
]}
286+
{
287+
name: "modify-allowed-area",
288+
helperText: "Modify Allowed Area",
289+
},
290+
]
291+
.filter(Boolean)
292+
.filter(
293+
(a) => a.alwaysShowing || state.enabledTools.includes(a.name)
294+
)}
282295
rightSidebarItems={[
283296
debugModeOn && (
284297
<DebugBox state={debugModeOn} lastAction={state.lastAction} />

src/MainLayout/index.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ storiesOf("MainLayout", module)
4444
},
4545
],
4646
mode: null,
47-
enabledTools: [],
47+
enabledTools: ["create-point", "create-polygon", "modify-allowed-area"],
4848
history: [{ name: "Reset Stuff", state: null, time: moment() }],
4949
}}
5050
dispatch={(a) => action(a.type)(a)}

0 commit comments

Comments
 (0)