Ensure that the splash screen can be moved. Fixes # 7471

This commit is contained in:
Akshay Joshi
2022-07-07 14:11:36 +05:30
parent 50c930f5fa
commit a16e3523bd
3 changed files with 44 additions and 25 deletions

View File

@@ -21,6 +21,7 @@ Housekeeping
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 #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.

View File

@@ -296,7 +296,7 @@ const setZoomLevelForAllWindows = () => {
for (let arr_val of winArray) {
arr_val.zoomLevel = pgAdminWindowObject.zoomLevel;
}
})
});
};
// This function used to zoom in the pgAdmin window.

View File

@@ -300,6 +300,24 @@ function launchPgAdminWindow() {
let gui = require('nw.gui');
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.
nw.App.clearCache();