Fixed an issue where on entering full screen, the option label is not changed to 'Exit Full Screen' in desktop mode. #6921

This commit is contained in:
Nikhil Mohite 2023-11-23 15:52:00 +05:30 committed by GitHub
parent 115208c8d8
commit 361ae458d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 12 deletions

View File

@ -459,18 +459,19 @@ function getRuntimeMenu() {
},
}));
subMenus.append(new nw.MenuItem({ type: 'separator' }));
subMenus.append(new gui.MenuItem({
label: runtimeSubMenus['enter_full_screen'].label,
enabled: runtimeSubMenus['enter_full_screen'].enable,
priority: runtimeSubMenus['enter_full_screen'].priority,
type: 'normal',
checked: false,
key: runtimeSubMenus['enter_full_screen'].key,
modifiers: runtimeSubMenus['enter_full_screen'].modifiers,
click: function () {
misc.toggleFullScreen();
},
}));
subMenus.append(new gui.MenuItem({
label: pgAdminMainScreen?.isFullscreen ? runtimeSubMenus['exit_full_screen'].label : runtimeSubMenus['enter_full_screen'].label,
enabled: runtimeSubMenus['enter_full_screen'].enable,
priority: runtimeSubMenus['enter_full_screen'].priority,
type: 'normal',
checked: false,
key: runtimeSubMenus['enter_full_screen'].key,
modifiers: runtimeSubMenus['enter_full_screen'].modifiers,
click: function () {
this.label = !pgAdminMainScreen?.isFullscreen ? runtimeSubMenus['exit_full_screen'].label : runtimeSubMenus['enter_full_screen'].label;
misc.toggleFullScreen();
},
}));
subMenus.append(new gui.MenuItem({
label: runtimeSubMenus['actual_size'].label,
enabled: runtimeSubMenus['actual_size'].enable,

View File

@ -35,6 +35,7 @@ if (browser == 'Nwjs') {
configure: { label: gettext('Configure...'), name: 'configure', priority: 0, enable: true},
view_log: { label: gettext('View log...'), name: 'view_log', priority: 1, enable: true},
enter_full_screen: { label: gettext('Enter Full Screen'), name: 'enter_full_screen', enable: true, priority: 2, key: fullScreenKey, modifiers: isMac() ?`${controlKey}+ctrl` : controlKey},
exit_full_screen: { label: gettext('Exit Full Screen'), name: 'exit_full_screen', enable: true, priority: 2, key: fullScreenKey, modifiers: isMac() ?`${controlKey}+ctrl` : controlKey},
actual_size: { label: gettext('Actual Size'), name: 'actual_size', priority: 3, enable: true, key: '0', modifiers: controlKey},
zoom_in: { label: gettext('Zoom In'), name: 'zoom_in', priority: 4, enable: true, key: '+', modifiers: controlKey},
zoom_out: { label: gettext('Zoom Out'), name: 'zoom_out', enable: true, priority: 5, key: '-', modifiers: controlKey},