Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a visual message when using the toggle full screen menu option #89

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions packages/app/client/src/ui/shell/appMenu/appMenuTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ import { MenuItem } from '@bfemulator/ui-react';
import { SharedConstants } from '@bfemulator/app-shared';
import { remote } from 'electron';

import { ariaAlertService } from '../../a11y';

const {
Channels: { HelpLabel, ReadmeUrl },
Commands: {
Expand Down Expand Up @@ -184,9 +182,15 @@ export class AppMenuTemplate {
const currentWindow = remote.getCurrentWindow();
currentWindow.setFullScreen(!currentWindow.isFullScreen());
if (currentWindow.isFullScreen()) {
ariaAlertService.alert('Entering full screen');
AppMenuTemplate.commandService.remoteCall(ShowMessageBox, null, {
message: 'Entering full screen.',
title: 'Toggle Full Screen option',
});
} else {
ariaAlertService.alert('Exiting full screen');
AppMenuTemplate.commandService.remoteCall(ShowMessageBox, null, {
message: 'Exiting full screen.',
title: 'Toggle Full Screen option',
});
}
},
subtext: 'F11',
Expand Down
12 changes: 9 additions & 3 deletions packages/app/client/src/utils/eventHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { isLinux, isMac, Notification, NotificationType, SharedConstants } from
import { CommandServiceImpl, CommandServiceInstance } from '@bfemulator/sdk-shared';
import { remote } from 'electron';

import { ariaAlertService } from '../ui/a11y';
const { Electron } = SharedConstants.Commands;

const maxZoomFactor = 3; // 300%
const minZoomFactor = 0.25; // 25%;
Expand Down Expand Up @@ -117,9 +117,15 @@ class EventHandlers {
const currentWindow = remote.getCurrentWindow();
currentWindow.setFullScreen(!currentWindow.isFullScreen());
if (currentWindow.isFullScreen()) {
ariaAlertService.alert('Entering full screen');
await EventHandlers.commandService.remoteCall(Electron.ShowMessageBox, false, {
message: 'Entering full screen.',
title: 'Toggle Full Screen option',
});
} else {
ariaAlertService.alert('Exiting full screen');
await EventHandlers.commandService.remoteCall(Electron.ShowMessageBox, false, {
message: 'Exiting full screen.',
title: 'Toggle Full Screen option',
});
}
}
// Ctrl+Shift+I
Expand Down