diff --git a/desktop/app/src/main/kotlin/com/abdownloadmanager/desktop/pages/settings/SettingWindow.kt b/desktop/app/src/main/kotlin/com/abdownloadmanager/desktop/pages/settings/SettingWindow.kt index 61b02e7c..47110fe4 100644 --- a/desktop/app/src/main/kotlin/com/abdownloadmanager/desktop/pages/settings/SettingWindow.kt +++ b/desktop/app/src/main/kotlin/com/abdownloadmanager/desktop/pages/settings/SettingWindow.kt @@ -9,28 +9,34 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.width import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.dp +import androidx.compose.ui.window.WindowPosition import androidx.compose.ui.window.rememberWindowState @Composable fun SettingWindow( settingsComponent: SettingsComponent, - onRequestCloseWindow:()->Unit, -){ - val state= rememberWindowState() + onRequestCloseWindow: () -> Unit, +) { + val state = rememberWindowState( + size = DpSize(width = 800.dp, height = 400.dp), + position = WindowPosition.Aligned(Alignment.Center), + ) CustomWindow(state, { onRequestCloseWindow() }) { - HandleEffects(settingsComponent){ - when(it){ + HandleEffects(settingsComponent) { + when (it) { SettingPageEffects.BringToFront -> { - state.isMinimized=false + state.isMinimized = false window.toFront() } } } // Spacer(Modifier.fillMaxWidth().height(1.dp).background(myColors.surface)) - SettingsPage(settingsComponent,onRequestCloseWindow) + SettingsPage(settingsComponent, onRequestCloseWindow) } } \ No newline at end of file