improved menu layout

This commit is contained in:
Odweta
2024-11-30 11:23:04 +01:00
parent f67e28b8f6
commit 5200e3ba07
@@ -36,29 +36,20 @@ fun MenuScreen(modifier: Modifier = Modifier) {
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
// Button to trigger the dialog
Button(
onClick = { showDialog = true },
colors = ButtonDefaults.buttonColors(
contentColor = Color.White,
containerColor = Color.Black
),
modifier = Modifier
.border(
width = 5.dp,
shape = RoundedCornerShape(roundedCornerDimen),
color = PastelYellow
)
.width(230.dp)
.height(80.dp)
) {
Text(
text = "Odhlásit se",
fontSize = 23.sp
)
}
MenuButton({ showDialog = true }, "Odhlásit se")
Spacer(modifier = Modifier.height(100.dp))
Spacer(modifier = Modifier.height(80.dp))
MenuButton({ screenToShow.value = Screen.SignIn }, "Změnit přihlášení")
Spacer(modifier = Modifier.height(80.dp))
MenuButton({ isShowing.value = IsShowing.About }, "O aplikaci")
Spacer(modifier = Modifier.height(80.dp))
MenuButton({ isShowing.value = IsShowing.Settings }, "Nastavení")
}
// Dialog implementation
if (showDialog) {
@@ -114,10 +105,12 @@ fun MenuScreen(modifier: Modifier = Modifier) {
}
)
}
}
Button(onClick = {
screenToShow.value = Screen.SignIn
},
@Composable
fun MenuButton(onClick: () -> Unit, text: String) {
Button(
onClick = onClick,
colors = ButtonDefaults.buttonColors(
contentColor = Color.White,
containerColor = Color.Black
@@ -132,57 +125,8 @@ fun MenuScreen(modifier: Modifier = Modifier) {
.height(80.dp)
) {
Text(
text = "Změnit přihlášení",
fontSize = 23.sp
)
}
Spacer(modifier = Modifier.height(100.dp))
Button(onClick = {
isShowing.value = IsShowing.About
},
colors = ButtonDefaults.buttonColors(
contentColor = Color.White,
containerColor = Color.Black
),
modifier = Modifier
.border(
width = 5.dp,
shape = RoundedCornerShape(roundedCornerDimen),
color = PastelYellow
)
.width(230.dp)
.height(80.dp)
) {
Text(
text = "O aplikaci",
fontSize = 23.sp
)
}
Spacer(modifier = Modifier.height(100.dp))
Button(onClick = {
isShowing.value = IsShowing.Settings
},
colors = ButtonDefaults.buttonColors(
contentColor = Color.White,
containerColor = Color.Black
),
modifier = Modifier
.border(
width = 5.dp,
shape = RoundedCornerShape(roundedCornerDimen),
color = PastelYellow
)
.width(230.dp)
.height(80.dp)
) {
Text(
text = "Nastavení",
text = text,
fontSize = 23.sp
)
}
}
}