|
@@ -127,6 +127,8 @@ private fun FontWeightSetting(
|
|
|
TinyDropdownSettingItem(
|
|
TinyDropdownSettingItem(
|
|
|
title = stringResource(R.string.font_weight_text),
|
|
title = stringResource(R.string.font_weight_text),
|
|
|
selectedValue = if (isCustom) "-1" else value.toString(),
|
|
selectedValue = if (isCustom) "-1" else value.toString(),
|
|
|
|
|
+ // 自定义时直接显示当前字重数值,而不是笼统的“自定义”
|
|
|
|
|
+ selectedDisplay = if (isCustom) sliderValue.toInt().toString() else null,
|
|
|
displayEntries = arrayOf(
|
|
displayEntries = arrayOf(
|
|
|
weightEntries[2],
|
|
weightEntries[2],
|
|
|
weightEntries[0],
|
|
weightEntries[0],
|
|
@@ -212,6 +214,7 @@ private fun PaddingSliders(
|
|
|
bottom: Float,
|
|
bottom: Float,
|
|
|
left: Float,
|
|
left: Float,
|
|
|
right: Float,
|
|
right: Float,
|
|
|
|
|
+ maxValue: Float = 200f,
|
|
|
onTopChange: (Float) -> Unit,
|
|
onTopChange: (Float) -> Unit,
|
|
|
onBottomChange: (Float) -> Unit,
|
|
onBottomChange: (Float) -> Unit,
|
|
|
onLeftChange: (Float) -> Unit,
|
|
onLeftChange: (Float) -> Unit,
|
|
@@ -220,28 +223,28 @@ private fun PaddingSliders(
|
|
|
TinySliderSettingItem(
|
|
TinySliderSettingItem(
|
|
|
title = stringResource(R.string.padding_top),
|
|
title = stringResource(R.string.padding_top),
|
|
|
value = top,
|
|
value = top,
|
|
|
- valueRange = 0f..200f,
|
|
|
|
|
|
|
+ valueRange = 0f..maxValue,
|
|
|
imageVector = Icons.Default.VerticalAlignTop,
|
|
imageVector = Icons.Default.VerticalAlignTop,
|
|
|
onValueChange = onTopChange,
|
|
onValueChange = onTopChange,
|
|
|
)
|
|
)
|
|
|
TinySliderSettingItem(
|
|
TinySliderSettingItem(
|
|
|
title = stringResource(R.string.padding_bottom),
|
|
title = stringResource(R.string.padding_bottom),
|
|
|
value = bottom,
|
|
value = bottom,
|
|
|
- valueRange = 0f..200f,
|
|
|
|
|
|
|
+ valueRange = 0f..maxValue,
|
|
|
imageVector = Icons.Default.VerticalAlignBottom,
|
|
imageVector = Icons.Default.VerticalAlignBottom,
|
|
|
onValueChange = onBottomChange,
|
|
onValueChange = onBottomChange,
|
|
|
)
|
|
)
|
|
|
TinySliderSettingItem(
|
|
TinySliderSettingItem(
|
|
|
title = stringResource(R.string.padding_left),
|
|
title = stringResource(R.string.padding_left),
|
|
|
value = left,
|
|
value = left,
|
|
|
- valueRange = 0f..200f,
|
|
|
|
|
|
|
+ valueRange = 0f..maxValue,
|
|
|
imageVector = Icons.Default.AlignHorizontalLeft,
|
|
imageVector = Icons.Default.AlignHorizontalLeft,
|
|
|
onValueChange = onLeftChange,
|
|
onValueChange = onLeftChange,
|
|
|
)
|
|
)
|
|
|
TinySliderSettingItem(
|
|
TinySliderSettingItem(
|
|
|
title = stringResource(R.string.padding_right),
|
|
title = stringResource(R.string.padding_right),
|
|
|
value = right,
|
|
value = right,
|
|
|
- valueRange = 0f..200f,
|
|
|
|
|
|
|
+ valueRange = 0f..maxValue,
|
|
|
imageVector = Icons.Default.AlignHorizontalRight,
|
|
imageVector = Icons.Default.AlignHorizontalRight,
|
|
|
onValueChange = onRightChange,
|
|
onValueChange = onRightChange,
|
|
|
)
|
|
)
|
|
@@ -946,6 +949,7 @@ internal fun TypographyMarginTab(
|
|
|
1 -> PaddingSliders(
|
|
1 -> PaddingSliders(
|
|
|
top = headerPaddingTop, bottom = headerPaddingBottom,
|
|
top = headerPaddingTop, bottom = headerPaddingBottom,
|
|
|
left = headerPaddingLeft, right = headerPaddingRight,
|
|
left = headerPaddingLeft, right = headerPaddingRight,
|
|
|
|
|
+ maxValue = 500f,
|
|
|
onTopChange = {
|
|
onTopChange = {
|
|
|
headerPaddingTop = it
|
|
headerPaddingTop = it
|
|
|
onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.HeaderPaddingTop(it.toInt())))
|
|
onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.HeaderPaddingTop(it.toInt())))
|
|
@@ -967,6 +971,7 @@ internal fun TypographyMarginTab(
|
|
|
else -> PaddingSliders(
|
|
else -> PaddingSliders(
|
|
|
top = footerPaddingTop, bottom = footerPaddingBottom,
|
|
top = footerPaddingTop, bottom = footerPaddingBottom,
|
|
|
left = footerPaddingLeft, right = footerPaddingRight,
|
|
left = footerPaddingLeft, right = footerPaddingRight,
|
|
|
|
|
+ maxValue = 500f,
|
|
|
onTopChange = {
|
|
onTopChange = {
|
|
|
footerPaddingTop = it
|
|
footerPaddingTop = it
|
|
|
onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.FooterPaddingTop(it.toInt())))
|
|
onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.FooterPaddingTop(it.toInt())))
|