Fix window bounds issue #10
This commit is contained in:
parent
f82bd92ff5
commit
f177b331db
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -243,6 +243,11 @@ export default new class V2_SettingsPanel {
|
|||
if (id === "no_window_bound"){
|
||||
let appSettings = remote.getGlobal("appSettings")
|
||||
appSettings.set("NO_WINDOWS_BOUND", enabled)
|
||||
|
||||
appSettings.delete("IS_MAXIMIZED")
|
||||
appSettings.delete("IS_MINIMIZED")
|
||||
appSettings.delete("WINDOW_BOUNDS")
|
||||
|
||||
appSettings.save()
|
||||
remote.app.relaunch()
|
||||
remote.app.exit()
|
||||
|
|
|
@ -151,6 +151,8 @@ function saveWindowConfig(browserWindow) {
|
|||
return;
|
||||
}
|
||||
|
||||
if(settings.get("NO_WINDOWS_BOUND"))return
|
||||
|
||||
settings.set('IS_MAXIMIZED', browserWindow.isMaximized());
|
||||
settings.set('IS_MINIMIZED', browserWindow.isMinimized());
|
||||
if (!settings.get('IS_MAXIMIZED') && !settings.get('IS_MINIMIZED')) {
|
||||
|
@ -203,14 +205,14 @@ function doAABBsOverlap(a, b) {
|
|||
}
|
||||
|
||||
function applyWindowBoundsToConfig(mainWindowOptions) {
|
||||
if (!settings.get('WINDOW_BOUNDS')) {
|
||||
const bounds = settings.get('WINDOW_BOUNDS')
|
||||
if (!bounds) {
|
||||
mainWindowOptions.center = true;
|
||||
return;
|
||||
}
|
||||
|
||||
const bounds = settings.get('WINDOW_BOUNDS');
|
||||
bounds.width = Math.max(MIN_WIDTH, bounds.width);
|
||||
bounds.height = Math.max(MIN_HEIGHT, bounds.height);
|
||||
bounds.width = typeof bounds.width === "number" ? Math.max(MIN_WIDTH, bounds.width) : mainWindowOptions.width;
|
||||
bounds.height = typeof bounds.height === "number" ? Math.max(MIN_HEIGHT, bounds.height) : mainWindowOptions.height;
|
||||
|
||||
let isVisibleOnAnyScreen = false;
|
||||
const displays = electron.screen.getAllDisplays();
|
||||
|
|
Loading…
Reference in New Issue