mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
1) Ensure that the zoom level should be set for the newly opened window.
2) Ensure that if the zoom level is changed on the main window then it should be applicable for all the opened windows. refs #6271
This commit is contained in:
@@ -293,10 +293,20 @@ const setZoomEvents = () => {
|
||||
});
|
||||
};
|
||||
|
||||
// This function is used to iterate all open windows and set the zoom level.
|
||||
const setZoomLevelForAllWindows = () => {
|
||||
nw.Window.getAll(function(winArray) {
|
||||
for (var i = 0; i < winArray.length; i++) {
|
||||
winArray[i].zoomLevel = pgAdminWindowObject.zoomLevel;
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
// This function used to zoom in the pgAdmin window.
|
||||
const zoomIn = () => {
|
||||
if (pgAdminWindowObject != null) {
|
||||
pgAdminWindowObject.zoomLevel += 0.5;
|
||||
setZoomLevelForAllWindows();
|
||||
ConfigureStore.set('zoomLevel', pgAdminWindowObject.zoomLevel);
|
||||
ConfigureStore.saveConfig();
|
||||
}
|
||||
@@ -306,6 +316,7 @@ const zoomIn = () => {
|
||||
const zoomOut = () => {
|
||||
if (pgAdminWindowObject != null) {
|
||||
pgAdminWindowObject.zoomLevel -= 0.5;
|
||||
setZoomLevelForAllWindows();
|
||||
ConfigureStore.set('zoomLevel', pgAdminWindowObject.zoomLevel);
|
||||
ConfigureStore.saveConfig();
|
||||
}
|
||||
@@ -315,6 +326,7 @@ const zoomOut = () => {
|
||||
const actualSize = () => {
|
||||
if (pgAdminWindowObject != null) {
|
||||
pgAdminWindowObject.zoomLevel = 0;
|
||||
setZoomLevelForAllWindows();
|
||||
ConfigureStore.set('zoomLevel', pgAdminWindowObject.zoomLevel);
|
||||
ConfigureStore.saveConfig();
|
||||
}
|
||||
@@ -458,5 +470,6 @@ module.exports = {
|
||||
setZoomEvents: setZoomEvents,
|
||||
registerZoomEvents: registerZoomEvents,
|
||||
unregisterZoomEvents: unregisterZoomEvents,
|
||||
setZoomLevelForAllWindows: setZoomLevelForAllWindows,
|
||||
ConfigureStore: ConfigureStore,
|
||||
};
|
||||
|
||||
@@ -118,14 +118,16 @@ function startDesktopMode() {
|
||||
'focus': true,
|
||||
'show': true,
|
||||
});
|
||||
} else if (chunk.indexOf('Runtime Zoom In') > -1) {
|
||||
} else if (chunk.indexOf('Runtime Zoom In') >= 0) {
|
||||
misc.zoomIn();
|
||||
} else if (chunk.indexOf('Runtime Zoom Out') > -1) {
|
||||
} else if (chunk.indexOf('Runtime Zoom Out') >= 0) {
|
||||
misc.zoomOut();
|
||||
} else if (chunk.indexOf('Runtime Actual Size') > -1) {
|
||||
} else if (chunk.indexOf('Runtime Actual Size') >= 0) {
|
||||
misc.actualSize();
|
||||
} else if (chunk.indexOf('Runtime Toggle Full Screen') > -1) {
|
||||
} else if (chunk.indexOf('Runtime Toggle Full Screen') >= 0) {
|
||||
misc.toggleFullScreen();
|
||||
} else if (chunk.indexOf('Runtime new window opened') >= 0) {
|
||||
misc.setZoomLevelForAllWindows();
|
||||
} else {
|
||||
misc.writeServerLog(chunk);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user