Add character-based text wrapping
Build & Test / Build & Test App (push) Has been cancelled
Release / Extract tag name (push) Has been cancelled
Update website / update_website (release) Has been cancelled
Release / Build (push) Has been cancelled
Release / Build (FOSS) (push) Has been cancelled
Release / Create GitHub Release (push) Has been cancelled

This commit is contained in:
BookOasis Reader
2026-09-29 12:36:37 +09:00
parent c622f74c62
commit a7edba607a
5 changed files with 118 additions and 7 deletions
@@ -33,6 +33,11 @@ private val fontFamilies = listOf(
MR.strings.pref_text_reader_font_mono to ReaderPreferences.TextFontFamily.MONOSPACE,
)
private val lineBreakModes = listOf(
MR.strings.pref_text_reader_line_break_word to ReaderPreferences.TextLineBreakMode.WORD,
MR.strings.pref_text_reader_line_break_character to ReaderPreferences.TextLineBreakMode.CHARACTER,
)
@Composable
internal fun ColumnScope.TextSettingsPage(viewModel: ReaderSettingsViewModel) {
val context = LocalContext.current
@@ -105,6 +110,21 @@ internal fun ColumnScope.TextSettingsPage(viewModel: ReaderSettingsViewModel) {
pillColor = MaterialTheme.colorScheme.surfaceContainerHighest,
)
val lineBreakModePref = viewModel.preferences.textLineBreakMode
val lineBreakMode by lineBreakModePref.collectAsState()
SettingsChipRow(MR.strings.pref_text_reader_line_break_mode) {
lineBreakModes.forEach { (label, value) ->
FilterChip(
selected = lineBreakMode == value,
onClick = {
lineBreakModePref.set(value)
viewModel.previewAndRequestTextSettingsReload()
},
label = { Text(stringResource(label)) },
)
}
}
val fontFamilyPref = viewModel.preferences.textFontFamily
val fontFamily by fontFamilyPref.collectAsState()
SettingsChipRow(MR.strings.pref_text_reader_font_family) {