Skip to content

Commit 18c9ea9

Browse files
committed
#483 style active color picker
1 parent f4a51e2 commit 18c9ea9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

webapp/components/general/ControlPanelTreeItem.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ const useStyles = makeStyles((theme) => ({
4141
},
4242
colorPickerBox: {
4343
position: 'absolute',
44-
top: '1rem',
44+
top: '1.25rem',
45+
right: '2.5rem',
4546
},
4647
triangleIcon: {
4748
marginBottom: '-7px',
@@ -68,6 +69,11 @@ const useStyles = makeStyles((theme) => ({
6869
background: 'transparent !important',
6970
},
7071
},
72+
activeColorPicker: {
73+
'& path': {
74+
fill: '#ffffff',
75+
},
76+
},
7177
}));
7278

7379
const ControlPanelTreeItem = (props) => {
@@ -183,14 +189,15 @@ const ControlPanelTreeItem = (props) => {
183189
{isHoveredOver
184190
? (
185191
<>
186-
187192
<IconButton onClick={(event) => changeVisibility(event, nodeId)}>
188193
{ visibility ? <Visibility /> : <VisibilityOff /> }
189194
</IconButton>
195+
<IconButton onClick={() => setShowColorPicker(true)}>
196+
<ColorLensIcon className={showColorPicker ? classes.activeColorPicker : ''} />
197+
</IconButton>
190198
<IconButton onClick={(event) => generateRandomColor(event, nodeId)}>
191199
<RandomColorLensIcon />
192200
</IconButton>
193-
<IconButton onClick={() => setShowColorPicker(true)}><ColorLensIcon /></IconButton>
194201
{
195202
showColorPicker
196203
? (
@@ -207,7 +214,6 @@ const ControlPanelTreeItem = (props) => {
207214
</Box>
208215
) : null
209216
}
210-
211217
</>
212218
)
213219
: null}

0 commit comments

Comments
 (0)