From a446b37c1f09c5be4c8693895814921c802479c5 Mon Sep 17 00:00:00 2001 From: arkon Date: Wed, 15 Jun 2022 18:02:08 -0400 Subject: [PATCH] Make Compose overflow menu feel slightly more like XML version --- .../java/eu/kanade/presentation/components/AppBar.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/components/AppBar.kt b/app/src/main/java/eu/kanade/presentation/components/AppBar.kt index 09b18a7fd0..92b415d716 100644 --- a/app/src/main/java/eu/kanade/presentation/components/AppBar.kt +++ b/app/src/main/java/eu/kanade/presentation/components/AppBar.kt @@ -1,6 +1,7 @@ package eu.kanade.presentation.components import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.widthIn import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.MoreVert import androidx.compose.material3.DropdownMenu @@ -14,9 +15,12 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp import eu.kanade.tachiyomi.R @Composable @@ -68,6 +72,7 @@ fun AppBarActions( } DropdownMenu( + modifier = Modifier.widthIn(min = 200.dp), expanded = showMenu, onDismissRequest = { showMenu = false }, ) { @@ -77,15 +82,15 @@ fun AppBarActions( it.onClick() showMenu = false }, - text = { Text(it.title) }, + text = { Text(it.title, fontWeight = FontWeight.Normal) }, ) } } } } -object AppBar { - interface AppBarAction +sealed interface AppBar { + sealed interface AppBarAction data class Action( val title: String,