Skip to content

Commit 916b762

Browse files
committed
fix(settings): Optimize UI display
1 parent 67fd990 commit 916b762

File tree

3 files changed

+52
-10
lines changed

3 files changed

+52
-10
lines changed

composeApp/src/commonMain/kotlin/com/jankinwu/fntv/client/data/store/AppSettingsStore.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ object AppSettingsStore {
1616
set(value) = settings.set(scopedKey("github_resource_proxy_url"), value)
1717

1818
var isFollowingSystemTheme: Boolean
19-
get() = settings.getBoolean(scopedKey("is_following_system_theme"), true)
19+
get() = settings.getBoolean(scopedKey("is_following_system_theme"), false)
2020
set(value) = settings.set(scopedKey("is_following_system_theme"), value)
2121

2222
var darkMode: Boolean

composeApp/src/commonMain/kotlin/com/jankinwu/fntv/client/ui/screen/MovieDetailScreen.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,7 @@ fun MediaQualityTag(qualityTag: String, scale: Float = 1f) {
10841084
RoundedCornerShape(4.dp * scale)
10851085
)
10861086
.padding(
1087+
top = if(qualityTag.contains("立体声")) 2.dp * scale else 0.dp,
10871088
start = 4.dp * scale,
10881089
end = 4.dp * scale,
10891090
bottom = 2.dp * scale

composeApp/src/commonMain/kotlin/com/jankinwu/fntv/client/ui/screen/SettingsScreen.kt

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import androidx.compose.animation.fadeOut
77
import androidx.compose.animation.shrinkVertically
88
import androidx.compose.foundation.Image
99
import androidx.compose.foundation.background
10+
import androidx.compose.foundation.border
1011
import androidx.compose.foundation.clickable
1112
import androidx.compose.foundation.interaction.MutableInteractionSource
1213
import androidx.compose.foundation.layout.Arrangement
@@ -80,6 +81,9 @@ import io.github.composefluent.icons.regular.ArrowUpRight
8081
import io.github.composefluent.icons.regular.Color
8182
import io.github.composefluent.icons.regular.Globe
8283
import 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
8387
import org.jetbrains.compose.resources.painterResource
8488
import 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

Comments
 (0)