Make Compose overflow menu feel slightly more like XML version

This commit is contained in:
arkon 2022-06-15 18:02:08 -04:00
parent ad75d137b0
commit a446b37c1f

View file

@ -1,6 +1,7 @@
package eu.kanade.presentation.components package eu.kanade.presentation.components
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.widthIn
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.MoreVert import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material3.DropdownMenu import androidx.compose.material3.DropdownMenu
@ -14,9 +15,12 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
@Composable @Composable
@ -68,6 +72,7 @@ fun AppBarActions(
} }
DropdownMenu( DropdownMenu(
modifier = Modifier.widthIn(min = 200.dp),
expanded = showMenu, expanded = showMenu,
onDismissRequest = { showMenu = false }, onDismissRequest = { showMenu = false },
) { ) {
@ -77,15 +82,15 @@ fun AppBarActions(
it.onClick() it.onClick()
showMenu = false showMenu = false
}, },
text = { Text(it.title) }, text = { Text(it.title, fontWeight = FontWeight.Normal) },
) )
} }
} }
} }
} }
object AppBar { sealed interface AppBar {
interface AppBarAction sealed interface AppBarAction
data class Action( data class Action(
val title: String, val title: String,