@@ -7,6 +7,7 @@ import androidx.compose.animation.fadeOut
77import androidx.compose.animation.shrinkVertically
88import androidx.compose.foundation.Image
99import androidx.compose.foundation.background
10+ import androidx.compose.foundation.border
1011import androidx.compose.foundation.clickable
1112import androidx.compose.foundation.interaction.MutableInteractionSource
1213import androidx.compose.foundation.layout.Arrangement
@@ -80,6 +81,9 @@ import io.github.composefluent.icons.regular.ArrowUpRight
8081import io.github.composefluent.icons.regular.Color
8182import io.github.composefluent.icons.regular.Globe
8283import io.github.composefluent.icons.regular.Navigation
84+ import io.github.composefluent.icons.regular.Person
85+ import io.github.composefluent.icons.regular.WeatherMoon
86+ import io.github.composefluent.icons.regular.WeatherSunny
8387import org.jetbrains.compose.resources.painterResource
8488import org.koin.compose.viewmodel.koinViewModel
8589
@@ -165,7 +169,7 @@ fun SettingsScreen(navigator: ComponentNavigator) {
165169 Text (" 主题模式" )
166170 },
167171 icon = {
168- Icon (Icons .Regular .Color , contentDescription = null )
172+ Icon (Icons .Regular .Color , contentDescription = null , modifier = Modifier .size( 18 .dp) )
169173 },
170174 caption = {
171175 Text (" 是否跟随系统主题" )
@@ -189,18 +193,18 @@ fun SettingsScreen(navigator: ComponentNavigator) {
189193 ) {
190194 CardExpanderItem (
191195 heading = {
192- Text (" 深色模式 " )
196+ Text (" 颜色 " )
193197 },
194198 icon = {
195- Icon (Icons .Regular .Color , contentDescription = null )
199+ Icon (if (store.darkMode) Icons .Regular .WeatherMoon else Icons . Regular . WeatherSunny , contentDescription = null , modifier = Modifier .size( 18 .dp) )
196200 },
197201 caption = {
198- Text (" 请选择是否使用深色模式 " )
202+ Text (" 请选择主题颜色 " )
199203 },
200204 trailing = {
201205 Switcher (
202206 checked = store.darkMode,
203- text = if (store.darkMode) " 是 " else " 否 " ,
207+ text = if (store.darkMode) " 深色 " else " 浅色 " ,
204208 textBefore = true ,
205209 onCheckStateChange = {
206210 store.darkMode = it
@@ -343,7 +347,7 @@ fun SettingsScreen(navigator: ComponentNavigator) {
343347 CardExpanderItem (
344348 heading = { Text (" 抢先体验" ) },
345349 caption = { Text (" 检测更新时是否包括预发布版本 (Alpha, Beta)" ) },
346- icon = { Icon (PreRelease , null , modifier = Modifier .size(18 .dp)) },
350+ icon = { Icon (PreRelease , null , modifier = Modifier .size(16 .dp)) },
347351 trailing = {
348352 Switcher (
349353 checked = includePrerelease,
@@ -490,9 +494,46 @@ fun SettingsScreen(navigator: ComponentNavigator) {
490494 Text (" 本项目为飞牛 OS 爱好者开发的第三方影视客户端,与飞牛影视官方无关。使用前请确保遵守相关服务条款。" )
491495 }
492496 )
493-
497+ val userInfo by UserInfoMemoryCache .userInfo.collectAsState()
494498 // 添加登出按钮
495- Header (" 账户" )
499+ Header (" 账号" )
500+ CardExpanderItem (
501+ icon = {
502+ Icon (
503+ imageVector = Icons .Regular .Person ,
504+ contentDescription = " 用户" ,
505+ modifier = Modifier
506+ .size(18 .dp)
507+ )
508+ },
509+ heading = {
510+ Row (
511+ verticalAlignment = Alignment .CenterVertically
512+ ) {
513+ Text (userInfo?.username ? : " " )
514+ if (userInfo?.isAdmin == 1 ) {
515+ Row (
516+ modifier = Modifier
517+ .padding(start = 8 .dp)
518+ .border(1 .dp, Colors .AccentColorDefault , RoundedCornerShape (50 ))
519+ .padding(horizontal = 6 .dp, vertical = 1 .dp),
520+ verticalAlignment = Alignment .CenterVertically
521+ ) {
522+ Text (
523+ text = " 管理员" ,
524+ style = FluentTheme .typography.caption,
525+ color = Colors .AccentColorDefault ,
526+ modifier = Modifier
527+ // .padding(start = 2.dp)
528+ )
529+ }
530+ }
531+ }
532+ },
533+ caption = {
534+ Text (" FN_Media" )
535+ }
536+ )
496537 CardExpanderItem (
497538 icon = {
498539 Icon (
@@ -506,7 +547,7 @@ fun SettingsScreen(navigator: ComponentNavigator) {
506547 Text (" 退出登录" )
507548 },
508549 caption = {
509- Text (" Sign out of your account " )
550+ Text (" 退出当前账号 " )
510551 },
511552 onClick = {
512553 LoginStateManager .logout(logoutViewModel)
0 commit comments