|
|
@@ -136,7 +136,6 @@ fun ThemeConfigScreen(
|
|
|
var showRestartDialog by remember { mutableStateOf(false) }
|
|
|
var showLauncherIconPicker by remember { mutableStateOf(false) }
|
|
|
var showBorderColorPicker by remember { mutableStateOf(false) }
|
|
|
- var currentBorderColorKey by remember { mutableStateOf("containerBorderColor") }
|
|
|
var showNavIconSheet by remember { mutableStateOf(false) }
|
|
|
var showFontSheet by remember { mutableStateOf(false) }
|
|
|
var fontItems by remember { mutableStateOf<List<FileDoc>>(emptyList()) }
|
|
|
@@ -609,62 +608,9 @@ fun ThemeConfigScreen(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // Border settings
|
|
|
+ // Container settings
|
|
|
item {
|
|
|
SplicedColumnGroup(title = "容器设置") {
|
|
|
- SwitchSettingItem(
|
|
|
- title = "显示容器边框",
|
|
|
- checked = ThemeConfig.enableContainerBorder,
|
|
|
- onCheckedChange = { ThemeConfig.enableContainerBorder = it }
|
|
|
- )
|
|
|
- if (ThemeConfig.enableContainerBorder) {
|
|
|
- SliderSettingItem(
|
|
|
- title = "边框粗细",
|
|
|
- description = "${ThemeConfig.containerBorderWidth}dp",
|
|
|
- value = ThemeConfig.containerBorderWidth,
|
|
|
- defaultValue = 1f,
|
|
|
- valueRange = 0f..5f,
|
|
|
- steps = 49,
|
|
|
- onValueChange = { ThemeConfig.containerBorderWidth = it }
|
|
|
- )
|
|
|
- DropdownListSettingItem(
|
|
|
- title = "边框样式",
|
|
|
- selectedValue = ThemeConfig.containerBorderStyle,
|
|
|
- displayEntries = arrayOf("实线", "虚线"),
|
|
|
- entryValues = arrayOf("solid", "dashed"),
|
|
|
- onValueChange = { ThemeConfig.containerBorderStyle = it }
|
|
|
- )
|
|
|
- if (ThemeConfig.containerBorderStyle == "dashed") {
|
|
|
- SliderSettingItem(
|
|
|
- title = "虚线间隔",
|
|
|
- description = "${ThemeConfig.containerBorderDashWidth}dp",
|
|
|
- value = ThemeConfig.containerBorderDashWidth,
|
|
|
- defaultValue = 4f,
|
|
|
- valueRange = 1f..10f,
|
|
|
- steps = 89,
|
|
|
- onValueChange = { ThemeConfig.containerBorderDashWidth = it }
|
|
|
- )
|
|
|
- }
|
|
|
- ClickableSettingItem(
|
|
|
- title = "边框颜色",
|
|
|
- option = if (ThemeConfig.containerBorderColor != 0) "#${Integer.toHexString(ThemeConfig.containerBorderColor).uppercase()}" else stringResource(R.string.click_to_select),
|
|
|
- onClick = {
|
|
|
- currentBorderColorKey = "containerBorderColor"
|
|
|
- showBorderColorPicker = true
|
|
|
- },
|
|
|
- trailingContent = {
|
|
|
- if (ThemeConfig.containerBorderColor != 0) {
|
|
|
- Box(
|
|
|
- modifier = Modifier
|
|
|
- .size(28.dp)
|
|
|
- .clip(CircleShape)
|
|
|
- .background(Color(ThemeConfig.containerBorderColor))
|
|
|
- .border(1.dp, MaterialTheme.colorScheme.outlineVariant, CircleShape)
|
|
|
- )
|
|
|
- }
|
|
|
- }
|
|
|
- )
|
|
|
- }
|
|
|
SwitchSettingItem(
|
|
|
title = "显示分割线",
|
|
|
checked = ThemeConfig.enableItemDivider,
|
|
|
@@ -693,7 +639,6 @@ fun ThemeConfigScreen(
|
|
|
title = "分割线颜色",
|
|
|
option = if (ThemeConfig.itemDividerColor != 0) "#${Integer.toHexString(ThemeConfig.itemDividerColor).uppercase()}" else stringResource(R.string.click_to_select),
|
|
|
onClick = {
|
|
|
- currentBorderColorKey = "itemDividerColor"
|
|
|
showBorderColorPicker = true
|
|
|
},
|
|
|
trailingContent = {
|
|
|
@@ -790,17 +735,11 @@ fun ThemeConfigScreen(
|
|
|
|
|
|
ColorPickerSheet(
|
|
|
show = showBorderColorPicker,
|
|
|
- initialColor = when (currentBorderColorKey) {
|
|
|
- "containerBorderColor" -> ThemeConfig.containerBorderColor
|
|
|
- "itemDividerColor" -> ThemeConfig.itemDividerColor
|
|
|
- else -> 0
|
|
|
- },
|
|
|
+ initialColor = ThemeConfig.itemDividerColor,
|
|
|
onDismissRequest = { showBorderColorPicker = false },
|
|
|
onColorSelected = {
|
|
|
- when (currentBorderColorKey) {
|
|
|
- "containerBorderColor" -> ThemeConfig.containerBorderColor = it
|
|
|
- "itemDividerColor" -> ThemeConfig.itemDividerColor = it
|
|
|
- }
|
|
|
+ ThemeConfig.itemDividerColor = it
|
|
|
+ showBorderColorPicker = false
|
|
|
}
|
|
|
)
|
|
|
|
|
|
@@ -813,10 +752,7 @@ fun ThemeConfigScreen(
|
|
|
imageVector = Icons.Default.Delete,
|
|
|
contentDescription = "清除",
|
|
|
onClick = {
|
|
|
- fontFolderUri = null
|
|
|
- context.putPrefString(PreferKey.fontFolder, "")
|
|
|
ThemeConfig.appFontPath = null
|
|
|
- fontItems = emptyList()
|
|
|
showFontSheet = false
|
|
|
}
|
|
|
)
|