merge: W2 — A2 interrupt scope(传输层 + 设置项)
This commit is contained in:
commit
b44e8d96b9
6 files changed
+233
-4
No files matched your search
@@ -21,6 +21,7 @@ import kotlinx.coroutines.launch
|
||||
import top.yeij.cyrene.BuildConfig
|
||||
import top.yeij.cyrene.app.AppContainer
|
||||
import top.yeij.cyrene.core.prefs.AppPrefs
|
||||
import top.yeij.cyrene.core.prefs.InterruptMode
|
||||
import top.yeij.cyrene.core.prefs.ThemeMode
|
||||
import top.yeij.cyrene.ui.common.PreferenceCard
|
||||
import top.yukonga.miuix.kmp.basic.BasicComponent
|
||||
@@ -102,6 +103,27 @@ fun SettingsScreen(
|
||||
)
|
||||
}
|
||||
|
||||
SectionTitle("她忙时发消息")
|
||||
InterruptMode.entries.forEach { mode ->
|
||||
PreferenceCard {
|
||||
BasicComponent(
|
||||
title = mode.label(),
|
||||
summary = mode.summary(),
|
||||
onClick = { scope.launch { settings.setInterruptMode(mode) } },
|
||||
endActions = {
|
||||
if (prefs.interruptMode == mode) {
|
||||
Text(
|
||||
text = "✓",
|
||||
style = MiuixTheme.textStyles.main,
|
||||
color = MiuixTheme.colorScheme.primary,
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
Spacer(Modifier.height(8.dp))
|
||||
}
|
||||
|
||||
SectionTitle("关于")
|
||||
PreferenceCard {
|
||||
BasicComponent(
|
||||
@@ -155,3 +177,19 @@ private fun ThemeMode.label(): String = when (this) {
|
||||
ThemeMode.Light -> "浅色"
|
||||
ThemeMode.Dark -> "深色"
|
||||
}
|
||||
|
||||
private fun InterruptMode.label(): String = when (this) {
|
||||
InterruptMode.AppendQueue -> "追加队列"
|
||||
InterruptMode.Interrupt -> "打断"
|
||||
}
|
||||
|
||||
/**
|
||||
* 两档的差别只有一处:**忙时那条排队消息还在不在**。文案必须说清这一点——
|
||||
* 一个用户看不懂效果的偏好,比没有这个偏好更糟。
|
||||
*/
|
||||
private fun InterruptMode.summary(): String = when (this) {
|
||||
InterruptMode.AppendQueue ->
|
||||
"她正忙时只把消息排进队列,等她做完当前回复再依次回;不打断(默认)"
|
||||
InterruptMode.Interrupt ->
|
||||
"她正忙时先打断当前这一句;已排队的消息保留,继续依次回答"
|
||||
}
|
||||
Reference in new issue
Block a user