fix: 修复长按朗读按钮打开的界面不正确,改为打开朗读设置路由

This commit is contained in:
HapeLee
2026-06-19 00:20:05 +08:00
parent 377a50bd6f
commit 96214ed856
@@ -717,7 +717,9 @@ private fun ReadBookMenuSurface(
onIntent(ReadBookIntent.HideMenu)
onIntent(ReadBookIntent.OpenChapterList)
},
onGoToBackground = { onIntent(ReadBookIntent.CloseReadBook) },
onGoToBackground = {
onIntent(ReadBookIntent.CloseReadBook(keepReadAloud = true))
},
onShowReadAloudConfig = {
onIntent(ReadBookIntent.ShowReadAloudConfig)
},
@@ -931,7 +933,7 @@ private fun MenuTitleBar(
verticalAlignment = Alignment.CenterVertically,
) {
MenuTitleGlassButton(
onClick = { onIntent(ReadBookIntent.CloseReadBook) },
onClick = { onIntent(ReadBookIntent.CloseReadBook()) },
icon = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = "Back",
state = state,
@@ -2591,7 +2593,9 @@ private fun loadToolButtons(
},
infoMap.getValue("read_aloud").toButton(
isActive = state.isReadAloudRunning,
onLongClick = { onIntent(ReadBookIntent.ShowReadAloudConfig) },
onLongClick = {
onIntent(ReadBookIntent.OpenReadMenuRoute(ReadBookMenuRoute.ReadAloud))
},
) {
if (state.isReadAloudRunning) {
onIntent(ReadBookIntent.OpenReadMenuRoute(ReadBookMenuRoute.ReadAloud))
@@ -2983,7 +2987,7 @@ private fun loadFloatingIcons(
isActive = id in activeIds,
onClick = actionMap[id] ?: {},
onLongClick = if (id == "read_aloud") {
{ onIntent(ReadBookIntent.ShowReadAloudConfig) }
{ onIntent(ReadBookIntent.OpenReadMenuRoute(ReadBookMenuRoute.ReadAloud)) }
} else {
null
},