place category page and add queue page in center of screen

This commit is contained in:
AmirHossein Abdolmotallebi 2024-11-03 15:43:29 +03:30
parent fc7c763146
commit a6be5c4edb
2 changed files with 10 additions and 3 deletions

View File

@ -3,8 +3,10 @@ package com.abdownloadmanager.desktop.pages.category
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.WindowPosition
import androidx.compose.ui.window.rememberWindowState
import com.abdownloadmanager.desktop.ui.customwindow.CustomWindow
@ -26,7 +28,8 @@ private fun CategoryDialog(
},
alwaysOnTop = true,
state = rememberWindowState(
size = DpSize(350.dp, 400.dp)
size = DpSize(350.dp, 400.dp),
position = WindowPosition.Aligned(Alignment.Center),
)
) {
NewCategory(component)

View File

@ -4,7 +4,10 @@ import com.abdownloadmanager.desktop.AppComponent
import com.abdownloadmanager.desktop.ui.customwindow.CustomWindow
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.ui.Alignment
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
@ -14,12 +17,13 @@ fun NewQueueDialog(
if (appComponent.showCreateQueueDialog.collectAsState().value){
CustomWindow(
state = rememberWindowState(
width = 300.dp,
height = 130.dp,
size = DpSize(width = 300.dp, height = 130.dp),
position = WindowPosition.Aligned(Alignment.Center),
),
resizable = false,
onRequestToggleMaximize = null,
onRequestMinimize = null,
alwaysOnTop = true,
onCloseRequest = {
appComponent.closeNewQueueDialog()
}