mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that the splash screen can be moved. Fixes # 7471
This commit is contained in:
@@ -21,6 +21,7 @@ Housekeeping
|
|||||||
Bug fixes
|
Bug fixes
|
||||||
*********
|
*********
|
||||||
|
|
||||||
|
| `Issue #7471 <https://redmine.postgresql.org/issues/7471>`_ - Ensure that the splash screen can be moved.
|
||||||
| `Issue #7517 <https://redmine.postgresql.org/issues/7517>`_ - Enable the start debugging button once execution is completed.
|
| `Issue #7517 <https://redmine.postgresql.org/issues/7517>`_ - Enable the start debugging button once execution is completed.
|
||||||
| `Issue #7518 <https://redmine.postgresql.org/issues/7518>`_ - Ensure that dashboard graph API is not called after the panel has been closed.
|
| `Issue #7518 <https://redmine.postgresql.org/issues/7518>`_ - Ensure that dashboard graph API is not called after the panel has been closed.
|
||||||
| `Issue #7522 <https://redmine.postgresql.org/issues/7522>`_ - Added support for Azure PostgreSQL deployment in server mode.
|
| `Issue #7522 <https://redmine.postgresql.org/issues/7522>`_ - Added support for Azure PostgreSQL deployment in server mode.
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ const setZoomLevelForAllWindows = () => {
|
|||||||
for (let arr_val of winArray) {
|
for (let arr_val of winArray) {
|
||||||
arr_val.zoomLevel = pgAdminWindowObject.zoomLevel;
|
arr_val.zoomLevel = pgAdminWindowObject.zoomLevel;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// This function used to zoom in the pgAdmin window.
|
// This function used to zoom in the pgAdmin window.
|
||||||
|
|||||||
@@ -243,32 +243,32 @@ function launchPgAdminWindow() {
|
|||||||
// set up handler for new-win-policy event.
|
// set up handler for new-win-policy event.
|
||||||
// Set the width and height for the new window.
|
// Set the width and height for the new window.
|
||||||
pgadminWindow.on('new-win-policy', function(frame, url, policy) {
|
pgadminWindow.on('new-win-policy', function(frame, url, policy) {
|
||||||
if(!frame) {
|
if(!frame) {
|
||||||
let openDocsInBrowser = misc.ConfigureStore.get('openDocsInBrowser', true);
|
let openDocsInBrowser = misc.ConfigureStore.get('openDocsInBrowser', true);
|
||||||
let isDocURL = false;
|
let isDocURL = false;
|
||||||
docsURLSubStrings.forEach(function(key) {
|
docsURLSubStrings.forEach(function(key) {
|
||||||
if(url.indexOf(key) >= 0) {
|
if(url.indexOf(key) >= 0) {
|
||||||
isDocURL = true;
|
isDocURL = true;
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (openDocsInBrowser && isDocURL) {
|
|
||||||
// Do not open the window
|
|
||||||
policy.ignore();
|
|
||||||
// Open URL in the external browser.
|
|
||||||
nw.Shell.openExternal(url);
|
|
||||||
} else {
|
|
||||||
policy.setNewWindowManifest({
|
|
||||||
'icon': '../../assets/pgAdmin4.png',
|
|
||||||
'frame': true,
|
|
||||||
'position': 'center',
|
|
||||||
'min_width': 640,
|
|
||||||
'min_height': 480,
|
|
||||||
'width': pgadminWindow.width,
|
|
||||||
'height': pgadminWindow.height,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (openDocsInBrowser && isDocURL) {
|
||||||
|
// Do not open the window
|
||||||
|
policy.ignore();
|
||||||
|
// Open URL in the external browser.
|
||||||
|
nw.Shell.openExternal(url);
|
||||||
|
} else {
|
||||||
|
policy.setNewWindowManifest({
|
||||||
|
'icon': '../../assets/pgAdmin4.png',
|
||||||
|
'frame': true,
|
||||||
|
'position': 'center',
|
||||||
|
'min_width': 640,
|
||||||
|
'min_height': 480,
|
||||||
|
'width': pgadminWindow.width,
|
||||||
|
'height': pgadminWindow.height,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
pgadminWindow.on('loaded', function() {
|
pgadminWindow.on('loaded', function() {
|
||||||
@@ -300,6 +300,24 @@ function launchPgAdminWindow() {
|
|||||||
let gui = require('nw.gui');
|
let gui = require('nw.gui');
|
||||||
let splashWindow = gui.Window.get();
|
let splashWindow = gui.Window.get();
|
||||||
|
|
||||||
|
// Enable dragging on the splash screen.
|
||||||
|
let isDragging = false;
|
||||||
|
let dragOrigin = {x:0, y:0};
|
||||||
|
document.mouseleave = ()=> isDragging = false;
|
||||||
|
document.onmouseup = ()=> isDragging = false;
|
||||||
|
|
||||||
|
document.onmousedown = (e)=> {
|
||||||
|
isDragging = true;
|
||||||
|
dragOrigin.x = e.x;
|
||||||
|
dragOrigin.y = e.y;
|
||||||
|
};
|
||||||
|
|
||||||
|
document.onmousemove = (e)=> {
|
||||||
|
if (isDragging) {
|
||||||
|
splashWindow.moveTo(e.screenX - dragOrigin.x, e.screenY - dragOrigin.y);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Always clear the cache before starting the application.
|
// Always clear the cache before starting the application.
|
||||||
nw.App.clearCache();
|
nw.App.clearCache();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user