mirror of
https://github.com/amir1376/ab-download-manager.git
synced 2025-02-20 11:43:24 +08:00
resize settings page and place it to center
This commit is contained in:
parent
bc7cb86643
commit
26a35aa1b7
@ -9,28 +9,34 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.unit.DpSize
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.ui.window.WindowPosition
|
||||||
import androidx.compose.ui.window.rememberWindowState
|
import androidx.compose.ui.window.rememberWindowState
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SettingWindow(
|
fun SettingWindow(
|
||||||
settingsComponent: SettingsComponent,
|
settingsComponent: SettingsComponent,
|
||||||
onRequestCloseWindow:()->Unit,
|
onRequestCloseWindow: () -> Unit,
|
||||||
){
|
) {
|
||||||
val state= rememberWindowState()
|
val state = rememberWindowState(
|
||||||
|
size = DpSize(width = 800.dp, height = 400.dp),
|
||||||
|
position = WindowPosition.Aligned(Alignment.Center),
|
||||||
|
)
|
||||||
CustomWindow(state, {
|
CustomWindow(state, {
|
||||||
onRequestCloseWindow()
|
onRequestCloseWindow()
|
||||||
}) {
|
}) {
|
||||||
HandleEffects(settingsComponent){
|
HandleEffects(settingsComponent) {
|
||||||
when(it){
|
when (it) {
|
||||||
SettingPageEffects.BringToFront -> {
|
SettingPageEffects.BringToFront -> {
|
||||||
state.isMinimized=false
|
state.isMinimized = false
|
||||||
window.toFront()
|
window.toFront()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Spacer(Modifier.fillMaxWidth().height(1.dp).background(myColors.surface))
|
// Spacer(Modifier.fillMaxWidth().height(1.dp).background(myColors.surface))
|
||||||
SettingsPage(settingsComponent,onRequestCloseWindow)
|
SettingsPage(settingsComponent, onRequestCloseWindow)
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user