Skip to content

Commit

Permalink
resize settings page and place it to center
Browse files Browse the repository at this point in the history
  • Loading branch information
amir1376 committed Nov 21, 2024
1 parent bc7cb86 commit 26a35aa
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 26a35aa

Please sign in to comment.