Skip to content

Commit

Permalink
show downloadmenuitems in cogwheel if headless (#10187)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwunderl authored Sep 16, 2024
1 parent e965209 commit 32ea5c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions webapp/src/container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ export class SettingsMenu extends data.Component<SettingsMenuProps, SettingsMenu
const showCenterDivider = targetTheme.selectLanguage || targetTheme.highContrast || showGreenScreen || githubUser;

const simCollapseText = headless ? lf("Toggle the File Explorer") : lf("Toggle the simulator");
const extMenuItems = pxt.commands.getDownloadMenuItems?.() || [];
const showDownloadMenuItems = headless && !!extMenuItems.length;

return <sui.DropdownMenu role="menuitem" icon={'setting large'} title={lf("Settings")} className="item icon more-dropdown-menuitem" ref={ref => this.dropdown = ref}>
{showHome && <sui.Item className="mobile only inherit" role="menuitem" icon="home" title={lf("Home")} text={lf("Home")} ariaLabel={lf("Home screen")} onClick={this.showExitAndSaveDialog} />}
Expand All @@ -329,6 +331,10 @@ export class SettingsMenu extends data.Component<SettingsMenuProps, SettingsMenu
{!isController ? <sui.Item role="menuitem" icon="trash" text={lf("Delete Project")} onClick={this.removeProject} /> : undefined}
{targetTheme.timeMachine ? <sui.Item role="menuitem" icon="history" text={lf("Version History")} onClick={this.showTurnBackTimeDialog} /> : undefined}
{showSimCollapse ? <sui.Item role="menuitem" icon='toggle right' text={simCollapseText} onClick={this.toggleCollapse} /> : undefined}
{showDownloadMenuItems && <>
<div className="ui divider" />
{extMenuItems.map((props, index) => <sui.Item key={"ext" + index} role="menuitem" tabIndex={-1} {...props} />)}
</>}
<div className="ui divider"></div>
{targetTheme.selectLanguage ? <sui.Item icon='xicon globe' role="menuitem" text={lf("Language")} onClick={this.showLanguagePicker} /> : undefined}
{targetTheme.highContrast ? <sui.Item role="menuitem" text={highContrast ? lf("High Contrast Off") : lf("High Contrast On")} onClick={this.toggleHighContrast} /> : undefined}
Expand Down

0 comments on commit 32ea5c7

Please sign in to comment.