Skip to content

Commit

Permalink
fix: use font face and size in selection bottom sheets (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
AkesiSeli authored Nov 4, 2024
1 parent 95d7e54 commit f4e0ef5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import com.livefast.eattrash.raccoonforlemmy.core.appearance.theme.IconSize
import com.livefast.eattrash.raccoonforlemmy.core.appearance.theme.Spacing
import com.livefast.eattrash.raccoonforlemmy.core.appearance.theme.toColor
import com.livefast.eattrash.raccoonforlemmy.core.appearance.theme.toReadableName
import com.livefast.eattrash.raccoonforlemmy.core.appearance.theme.toTypography
import com.livefast.eattrash.raccoonforlemmy.core.commonui.components.MultiColorPreview
import com.livefast.eattrash.raccoonforlemmy.core.commonui.lemmyui.SettingsRow
import com.livefast.eattrash.raccoonforlemmy.core.commonui.lemmyui.SettingsSwitchRow
Expand Down Expand Up @@ -575,6 +576,11 @@ class SettingsColorAndFontScreen : Screen {
items.map { fontFamily ->
CustomModalBottomSheetItem(
label = fontFamily.toUiFontFamily().toReadableName(),
customLabelStyle =
fontFamily
.toUiFontFamily()
.toTypography()
.titleMedium,
)
},
onSelected = { index ->
Expand Down Expand Up @@ -605,6 +611,10 @@ class SettingsColorAndFontScreen : Screen {
items.map { font ->
CustomModalBottomSheetItem(
label = font.toFontScale().toReadableName(),
customLabelStyle =
MaterialTheme.typography.titleMedium.let {
it.copy(fontSize = it.fontSize * font)
},
)
},
onSelected = { index ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import com.livefast.eattrash.raccoonforlemmy.core.appearance.data.toReadableName
import com.livefast.eattrash.raccoonforlemmy.core.appearance.data.toUiFontFamily
import com.livefast.eattrash.raccoonforlemmy.core.appearance.repository.ContentFontClass
import com.livefast.eattrash.raccoonforlemmy.core.appearance.theme.Spacing
import com.livefast.eattrash.raccoonforlemmy.core.appearance.theme.toTypography
import com.livefast.eattrash.raccoonforlemmy.core.commonui.lemmyui.SettingsHeader
import com.livefast.eattrash.raccoonforlemmy.core.commonui.lemmyui.SettingsIntValueRow
import com.livefast.eattrash.raccoonforlemmy.core.commonui.lemmyui.SettingsRow
Expand Down Expand Up @@ -360,6 +361,11 @@ class ConfigureContentViewScreen : Screen {
items.map { fontFamily ->
CustomModalBottomSheetItem(
label = fontFamily.toUiFontFamily().toReadableName(),
customLabelStyle =
fontFamily
.toUiFontFamily()
.toTypography()
.titleMedium,
)
},
onSelected = { index ->
Expand Down Expand Up @@ -390,6 +396,10 @@ class ConfigureContentViewScreen : Screen {
items.map { font ->
CustomModalBottomSheetItem(
label = font.toFontScale().toReadableName(),
customLabelStyle =
MaterialTheme.typography.titleMedium.let {
it.copy(fontSize = it.fontSize * font)
},
)
},
onSelected = { index ->
Expand Down

0 comments on commit f4e0ef5

Please sign in to comment.