From 06a4833ccd37fd69dfbf4fad8e06e749f43a6875 Mon Sep 17 00:00:00 2001 From: Syer10 Date: Thu, 27 May 2021 00:30:03 -0400 Subject: [PATCH] If window is maximized, reset values to default --- src/main/kotlin/ca/gosyer/data/ui/model/WindowSettings.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/kotlin/ca/gosyer/data/ui/model/WindowSettings.kt b/src/main/kotlin/ca/gosyer/data/ui/model/WindowSettings.kt index bbcd0a6c..b6628614 100644 --- a/src/main/kotlin/ca/gosyer/data/ui/model/WindowSettings.kt +++ b/src/main/kotlin/ca/gosyer/data/ui/model/WindowSettings.kt @@ -19,6 +19,14 @@ data class WindowSettings( val maximized: Boolean? = null ) { fun get(): WindowGet { + if (maximized == true) { + // Maximize messes with the other parameters so set them to default + return WindowGet( + IntOffset.Zero, + IntSize(800, 600), + true + ) + } val offset = if (x != null && y != null) { IntOffset(x, y) } else {