@@ -11,46 +11,16 @@ import ChevronRightIcon from '@material-ui/icons/ChevronRight';
1111import ChevronLeftIcon from '@material-ui/icons/ChevronLeft' ;
1212import Typography from '@material-ui/core/Typography' ;
1313
14- import AdjustIcon from '@material-ui/icons/Adjust' ;
1514import { WidgetStatus } from '../../constants' ;
1615import {
17- HLS_WIDGETS , PYTHON_CONSOLE_WIDGET ,
16+ HLS_WIDGETS , getPythonConsoleWidget ,
1817 MORPHOLOGY_WIDGET , PLOTS_WIDGETS
1918} from '../../redux/reducers/flexlayout'
2019
21- import {
22- PopulationIcon , CellIcon , SynapseIcon , NetworkIcon ,
23- SourceIcon , TargetIcon , CogsIcon , SliderHIcon , CodeIcon
24- } from '../general/NetPyNEIcons'
20+ import DrawerIcon from '../general/NetPyNEIcons'
2521
26- // Avoid defining properties with css || inline style
27- const useIconStyles = makeStyles ( ( { palette } ) => ( { icon : { color : props => props . selected ? palette . primary . main : palette . common . white } } ) )
2822
29- const DrawerIcon = ( { widgetId, selected } ) => {
30- const classes = useIconStyles ( { selected } )
31- switch ( widgetId ) {
32- case 'popParams' :
33- return < PopulationIcon fontSize = "large" className = { classes . icon } />
34- case 'cellParams' :
35- return < CellIcon fontSize = "large" className = { classes . icon } />
36- case 'synMechParams' :
37- return < SynapseIcon fontSize = "large" className = { classes . icon } />
38- case 'connParams' :
39- return < NetworkIcon fontSize = "large" className = { classes . icon } />
40- case 'stimSourceParams' :
41- return < SourceIcon fontSize = "large" className = { classes . icon } />
42- case 'stimTargetParams' :
43- return < TargetIcon fontSize = "large" className = { classes . icon } />
44- case 'simConfig' :
45- return < CogsIcon fontSize = "large" className = { classes . icon } />
46- case 'analysis' :
47- return < SliderHIcon fontSize = "large" className = { classes . icon } />
48- case 'python' :
49- return < CodeIcon fontSize = "large" className = { classes . icon } />
50- default :
51- return < AdjustIcon fontSize = "large" className = { classes . icon } />
52- }
53- }
23+ // Avoid defining properties with css || inline style
5424const drawerOpenWidth = 200 ;
5525const drawerCloseWidth = 48 ;
5626
@@ -101,7 +71,7 @@ export default ({ widgets, newWidget, editMode, activateWidget }) => {
10171 function createFocusWidget ( widgetId ) {
10272 if ( ! widgets [ widgetId ] ) {
10373 // pick from the list of available widgets
104- let widget = ( { ...HLS_WIDGETS , python : PYTHON_CONSOLE_WIDGET } ) [ widgetId ]
74+ let widget = ( { ...HLS_WIDGETS , pythonEdit : getPythonConsoleWidget ( true ) } ) [ widgetId ]
10575 if ( ! editMode ) {
10676 widget = simulateModeWidget ( widgetId )
10777 }
@@ -119,19 +89,19 @@ export default ({ widgets, newWidget, editMode, activateWidget }) => {
11989 return PLOTS_WIDGETS [ widgetId ]
12090 }
12191 // pick from the list of available widgets
122- return ( { D3Canvas : MORPHOLOGY_WIDGET , python : PYTHON_CONSOLE_WIDGET } ) [ widgetId ]
92+ return ( { D3Canvas : MORPHOLOGY_WIDGET , pythonExplore : getPythonConsoleWidget ( false ) } ) [ widgetId ]
12393 }
12494
12595
12696 function getMenu ( ) {
12797 if ( editMode ) {
12898 const array = [ ...Object . values ( HLS_WIDGETS ) ,
129- PYTHON_CONSOLE_WIDGET ]
99+ getPythonConsoleWidget ( true ) ]
130100 return array
131101 } else {
132102 const array = [ MORPHOLOGY_WIDGET ,
133103 ...Object . values ( PLOTS_WIDGETS ) ,
134- PYTHON_CONSOLE_WIDGET ]
104+ getPythonConsoleWidget ( false ) ]
135105
136106 return array
137107 }
0 commit comments