Skip to content

Commit d4b28ab

Browse files
committed
Rearrange jupyter and poll icons
1 parent 7988ab0 commit d4b28ab

File tree

2 files changed

+53
-16
lines changed

2 files changed

+53
-16
lines changed

src/ui/toolbox/toolbox.jsx

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,12 @@ export class ToolBox extends ToolHandling {
298298
reactivate() {
299299
console.log('reactivate toolbox')
300300
this.addRemoveSecondToolGuardian(true)
301-
this.setState({ activated: true, selectedButtonid: this.lasttool })
301+
this.setState({
302+
activated: true,
303+
selectedButtonid: this.lasttool,
304+
secondtoolstep: 0,
305+
thirdtoolstep: 0
306+
})
302307
}
303308

304309
deactivate() {
@@ -408,19 +413,6 @@ export class ToolBox extends ToolHandling {
408413
/>
409414
)
410415

411-
const ipynbbutton = (
412-
<Button
413-
icon={fiJupyterLiteIcon}
414-
tooltip='Jupyter lite base apps and more'
415-
tooltipOptions={ttopts}
416-
key={11}
417-
onClick={(e) => {
418-
this.ipynbButtonPressed()
419-
}}
420-
className='p-button-secondary p-button-raised p-button-rounded tbChild'
421-
/>
422-
)
423-
424416
const addformpictbutton = (
425417
<Button
426418
icon={fiFormPictSubMenuIcon}
@@ -432,6 +424,17 @@ export class ToolBox extends ToolHandling {
432424
/>
433425
)
434426

427+
const startactivitybutton = (
428+
<Button
429+
icon={<b>A</b>}
430+
tooltip='Start activity'
431+
tooltipOptions={ttopts}
432+
key={11}
433+
onClick={(e) => this.selectTool(11)}
434+
className={selbuttonclass(this.state.selectedButtonid === 11)}
435+
/>
436+
)
437+
435438
// onPointerLeave={this.scrollPointerup}
436439
const scrollbutton = (
437440
<Button
@@ -539,7 +542,8 @@ export class ToolBox extends ToolHandling {
539542
if (this.state.canundo) maintools.push(undobutton)
540543
maintools.push(addformpictbutton)
541544
maintools.push(laserbutton)
542-
maintools.push(pollbutton)
545+
if (!this.props.experimental) maintools.push(pollbutton)
546+
else maintools.push(startactivitybutton)
543547
maintools.push(endbutton)
544548
maintools.push(scrollbutton)
545549

@@ -851,7 +855,6 @@ export class ToolBox extends ToolHandling {
851855
}
852856
if (idents.length > 0) settingswheel.push(identbutton)
853857
if (this.props.startUpAVBroadcast) settingswheel.push(avstartupbutton)
854-
if (this.props.experimental) settingswheel.push(ipynbbutton)
855858
settingswheel.push(infobutton)
856859

857860
let setwheelpcpos = false
@@ -958,6 +961,30 @@ export class ToolBox extends ToolHandling {
958961
</div>
959962
))
960963

964+
const ipynbbutton = (
965+
<Button
966+
icon={fiJupyterLiteIcon}
967+
tooltip='Jupyter lite base apps and more'
968+
tooltipOptions={ttopts}
969+
key={11}
970+
onClick={(e) => {
971+
this.ipynbButtonPressed()
972+
}}
973+
className='p-button-secondary p-button-raised p-button-rounded tbChild'
974+
/>
975+
)
976+
977+
const activitywheel = []
978+
activitywheel.push(pollbutton)
979+
if (this.props.experimental) activitywheel.push(ipynbbutton)
980+
981+
let activitywheelcpos = false
982+
if (this.state.selectedButtonid === 11) {
983+
if (this.state.secondtoolstep === 1) {
984+
activitywheelcpos = true
985+
}
986+
}
987+
961988
const { colorwheel, pensizewheel, tmcolorwheel, bcolorwheel, fcolorwheel } =
962989
this.getColorButtons({
963990
addclass: 'p-mr-2 p-mb-2',
@@ -1088,6 +1115,11 @@ export class ToolBox extends ToolHandling {
10881115
{formpictwheel}
10891116
</div>
10901117
)}
1118+
{activitywheelcpos && (
1119+
<div className='p-d-flex p-flex-wrap p-jc-center fadeMenu'>
1120+
{activitywheel}
1121+
</div>
1122+
)}
10911123
{cwheelcpos && (
10921124
<div className='p-d-flex p-flex-wrap p-jc-center fadeMenu'>
10931125
{colorwheel}

src/ui/toolbox/toolhandling.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ export class ToolHandling extends Component {
204204
this.setState({ selectedFormid: undefined })
205205
this.addRemoveSecondToolGuardian(false, this.lasttool)
206206
break
207+
case 11: // startActivityMenu menu
208+
if (this.blackboard()) this.blackboard().setMenuMode()
209+
this.addRemoveSecondToolGuardian(true, this.lasttool)
210+
break
207211
default:
208212
break
209213
}
@@ -220,6 +224,7 @@ export class ToolHandling extends Component {
220224
case 1:
221225
case 4:
222226
case 10:
227+
case 11:
223228
secondtoolstep = 1
224229
newbuttonid = buttonid
225230
break

0 commit comments

Comments
 (0)