Skip to content

Commit 1355be5

Browse files
Refactor: Use FontText in SettingsTextPreference
The `SettingsTextPreference` composable now utilizes the custom `FontText` component for its label instead of the standard `Text` component. This aligns it with other parts of the settings UI. Additionally, a new `textAlign` parameter has been added to the `FontText` composable, allowing for text alignment to be specified. This parameter is passed down to the underlying `Text` composables.
1 parent 8066e79 commit 1355be5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/main/java/com/github/codeworkscreativehub/mlauncher/ui/compose/SettingsComposable.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ object SettingsComposable {
429429
) {
430430

431431
// Label
432-
Text(
432+
FontText(
433433
text = text,
434434
fontSize = resolvedFontSizeSp.sp,
435435
color = titleColor,
@@ -545,6 +545,7 @@ object SettingsComposable {
545545
color: Color = SettingsTheme.typography.title.color,
546546
fontWeight: FontWeight? = null,
547547
style: TextStyle? = null, // Optional additional style
548+
textAlign: TextAlign? = null,
548549
onClick: (() -> Unit)? = null,
549550
onTextLayout: ((TextLayoutResult) -> Unit)? = null
550551
) {
@@ -591,6 +592,7 @@ object SettingsComposable {
591592
text = text,
592593
modifier = modifier.then(clickableModifier),
593594
style = finalStyle,
595+
textAlign = textAlign,
594596
onTextLayout = onTextLayout
595597
)
596598
}
@@ -601,6 +603,7 @@ object SettingsComposable {
601603
text = text,
602604
modifier = modifier.then(clickableModifier),
603605
style = finalStyle,
606+
textAlign = textAlign,
604607
onTextLayout = onTextLayout
605608
)
606609
}

0 commit comments

Comments
 (0)