(feat) custom typography schemes

This commit is contained in:
MM20
2025-06-18 22:28:13 +02:00
parent 4bf9ee8b0c
commit da8416a58c
31 changed files with 2856 additions and 117 deletions
@@ -1834,4 +1834,69 @@ val _RoundedCornerAlt = materialIcon("Icons.Rounded.RoundedCornerAlt") {
}
val Icons.Rounded.RoundedCornerAlt
get() = _RoundedCornerAlt
get() = _RoundedCornerAlt
private val _LetterSpacing2 = materialIcon("Icons.Rounded.LetterSpacing2") {
materialPath {
moveTo(6.7f, 21.5125f)
quadToRelative(-0.275f, 0.275f, -0.7f, 0.275f)
quadToRelative(-0.425f, 0f, -0.7f, -0.275f)
lineToRelative(-2.6f, -2.6f)
quadToRelative(-0.3f, -0.3f, -0.3f, -0.7f)
quadToRelative(0f, -0.4f, 0.3f, -0.7f)
lineToRelative(2.6f, -2.6f)
quadToRelative(0.275f, -0.275f, 0.6875f, -0.275f)
quadToRelative(0.4125f, 0f, 0.7125f, 0.275f)
quadToRelative(0.3f, 0.3f, 0.3f, 0.7125f)
quadToRelative(0f, 0.4125f, -0.3f, 0.7125f)
lineToRelative(-0.875f, 0.875f)
horizontalLineToRelative(12.35f)
lineToRelative(-0.9f, -0.9f)
quadTo(17f, 16.0375f, 17f, 15.625f)
quadToRelative(0f, -0.4125f, 0.3f, -0.7125f)
quadToRelative(0.275f, -0.275f, 0.7f, -0.275f)
quadToRelative(0.425f, 0f, 0.7f, 0.275f)
lineToRelative(2.6f, 2.6f)
quadToRelative(0.3f, 0.3f, 0.3f, 0.7f)
quadToRelative(0f, 0.4f, -0.3f, 0.7f)
lineToRelative(-2.6f, 2.6f)
quadToRelative(-0.275f, 0.275f, -0.6875f, 0.275f)
quadToRelative(-0.4125f, 0f, -0.7125f, -0.275f)
quadToRelative(-0.3f, -0.3f, -0.3f, -0.7125f)
quadToRelative(0f, -0.4125f, 0.3f, -0.7125f)
lineToRelative(0.875f, -0.875f)
horizontalLineTo(5.825f)
lineToRelative(0.9f, 0.9f)
quadTo(7f, 20.3875f, 7f, 20.8f)
quadTo(7f, 21.2125f, 6.7f, 21.5125f)
close()
moveToRelative(0.65f, -9.5f)
lineToRelative(3.425f, -9.2f)
quadTo(10.875f, 2.5375f, 11.1125f, 2.375f)
quadTo(11.35f, 2.2125f, 11.65f, 2.2125f)
horizontalLineToRelative(0.7f)
quadToRelative(0.3f, 0f, 0.5375f, 0.1625f)
quadToRelative(0.2375f, 0.1625f, 0.3375f, 0.4375f)
lineToRelative(3.425f, 9.225f)
quadToRelative(0.15f, 0.425f, -0.1f, 0.8f)
quadToRelative(-0.25f, 0.375f, -0.7f, 0.375f)
quadToRelative(-0.275f, 0f, -0.5125f, -0.1625f)
quadTo(15.1f, 12.8875f, 15f, 12.6125f)
lineToRelative(-0.75f, -2.2f)
horizontalLineTo(9.8f)
lineTo(9f, 12.6375f)
quadToRelative(-0.1f, 0.275f, -0.325f, 0.425f)
quadToRelative(-0.225f, 0.15f, -0.5f, 0.15f)
quadToRelative(-0.475f, 0f, -0.7375f, -0.3875f)
quadTo(7.175f, 12.4375f, 7.35f, 12.0125f)
close()
moveToRelative(3f, -3.2f)
horizontalLineToRelative(3.3f)
lineToRelative(-1.6f, -4.55f)
horizontalLineToRelative(-0.1f)
close()
}
}
val Icons.Rounded.LetterSpacing2
get() = _LetterSpacing2
@@ -439,6 +439,7 @@
<string name="preference_shapes_extra_round">Extra round</string>
<string name="preference_shapes_rect">Rectangular</string>
<string name="preference_shapes_base">Base shape</string>
<string name="preference_screen_typography">Typography</string>
<string name="preference_screen_transparencies">Transparency</string>
<string name="preference_transparencies_default">Default</string>
<string name="preference_transparencies_semi_transparent">Semi-transparent</string>
@@ -824,6 +825,7 @@
<string name="note_widget_file_write_error_description">The note could not be written to the linked file. Possibly, it has been moved or deleted. A copy has been saved to the launcher\'s internal storage.</string>
<string name="confirmation_delete_color_scheme">Do you really want to delete the color scheme %1$s\?</string>
<string name="confirmation_delete_shapes_scheme">Do you really want to delete the shape scheme %1$s?</string>
<string name="confirmation_delete_typography_scheme">Do you really want to delete the typography scheme %1$s?</string>
<string name="confirmation_delete_transparencies_scheme">Do you really want to delete the transparency scheme %1$s?</string>
<string name="new_theme_name">(untitled)</string>
<string name="theme_color_scheme_system_default">Use system default</string>
@@ -18,6 +18,8 @@ data class LauncherSettingsData internal constructor(
val uiShapesId: UUID = UUID(0L, 0L),
@Serializable(with = UUIDSerializer::class)
val uiTransparenciesId: UUID = UUID(0L, 0L),
@Serializable(with = UUIDSerializer::class)
val uiTypographyId: UUID = UUID(0L, 0L),
val uiCompatModeColors: Boolean = false,
val uiFont: Font = Font.Outfit,
@@ -318,6 +318,17 @@ class UiSettings internal constructor(
}
}
val typographyId
get() = launcherDataStore.data.map {
it.uiTypographyId
}.distinctUntilChanged()
fun setTypographyId(typographyId: UUID) {
launcherDataStore.update {
it.copy(uiTypographyId = typographyId)
}
}
val font
get() = launcherDataStore.data.map {
it.uiFont