- Move 'About pgAdmin 4' to app menu on macOS. #7289

- Add appropriate minimum width and height setting for desktop apps to avoid app accidentally going below visibility levels. #7988
This commit is contained in:
Rohit Bhati 2024-10-03 16:29:11 +05:30 committed by GitHub
parent a1f8e010b7
commit 33c88ceb68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 4 deletions

View File

@ -41,6 +41,20 @@ function buildMenu(pgadminMenus, pgAdminMainScreen, callbacks) {
}); });
let menuFile = pgadminMenus.shift(); let menuFile = pgadminMenus.shift();
if (isMac) {
// Remove About pgAdmin 4 from help menu and add it to the top of menuFile submenu.
const helpMenu = pgadminMenus.find((menu) => menu.name == 'help');
if (helpMenu) {
const aboutItem = helpMenu.submenu.find((item) => item.name === 'mnu_about');
if (aboutItem) {
helpMenu.submenu = helpMenu.submenu.filter((item) => item.name !== 'mnu_about');
menuFile.submenu.unshift(aboutItem);
menuFile.submenu.splice(1, 0, { type: 'separator' });
}
}
}
template.push({ template.push({
...menuFile, ...menuFile,
submenu: [ submenu: [

View File

@ -264,8 +264,8 @@ function launchPgAdminWindow() {
'frame': true, 'frame': true,
'position': 'center', 'position': 'center',
'resizable': true, 'resizable': true,
'min_width': 640, 'minWidth': 640,
'min_height': 480, 'minHeight': 480,
'width': 1024, 'width': 1024,
'height': 768, 'height': 768,
'focus': true, 'focus': true,
@ -323,8 +323,8 @@ function launchPgAdminWindow() {
action: 'allow', action: 'allow',
overrideBrowserWindowOptions: { overrideBrowserWindowOptions: {
'position': 'center', 'position': 'center',
'min_width': 640, 'minWidth': 640,
'min_height': 480, 'minHeight': 480,
icon: '../../assets/pgAdmin4.png', icon: '../../assets/pgAdmin4.png',
...pgAdminMainScreen.getBounds(), ...pgAdminMainScreen.getBounds(),
webPreferences: { webPreferences: {