From 302bfce710ab0feea439abe3d57e62fe46a1ae4d Mon Sep 17 00:00:00 2001 From: SuperDragonXD <70206496+SuperDragonXD@users.noreply.github.com> Date: Sat, 18 Apr 2026 17:28:07 +0800 Subject: [PATCH] feat: Add additional icon shapes (#6651) --- lawnchair/res/values/strings.xml | 10 ++++ .../app/lawnchair/icons/shape/IconShape.kt | 56 +++++++++++++++++++ .../destinations/IconShapePreference.kt | 9 +++ 3 files changed, 75 insertions(+) diff --git a/lawnchair/res/values/strings.xml b/lawnchair/res/values/strings.xml index b10c63a204..a559654c72 100644 --- a/lawnchair/res/values/strings.xml +++ b/lawnchair/res/values/strings.xml @@ -324,6 +324,16 @@ Four-sided cookie Seven-sided cookie Arch + + Cloudy + Flower + Heart + Leaf + Meow + Pebble + Rounded Hexagon + Stretched + Vessel Custom icon shape diff --git a/lawnchair/src/app/lawnchair/icons/shape/IconShape.kt b/lawnchair/src/app/lawnchair/icons/shape/IconShape.kt index f9ac510339..f16348243f 100644 --- a/lawnchair/src/app/lawnchair/icons/shape/IconShape.kt +++ b/lawnchair/src/app/lawnchair/icons/shape/IconShape.kt @@ -433,6 +433,53 @@ sealed class IconShape { override val windowTransitionRadius = 0.16f } + // Additional shapes from https://github.com/Evolution-X/vendor_extras/blob/bq2/themes/iconshapes/ + + object Cloudy : PathBased( + key = "cloudy", + svgPathString = "M4,50 C2,45 0,39 0,33 C0,15 15,0 33,0 C39,0 45,2 50,4 C55,2 61,0 67,0 C85,0 100,15 100,33 C100,39 98,45 96,50 C98,55 100,61 100,66 C100,85 85,100 66,100 C61,100 55,98 50,96 C45,98 39,100 33,100 C15,100 0,85 0,66 C0,61 2,55 3,50 Z", + ) + + object Flower : PathBased( + key = "flower", + svgPathString = "M50,0 C60.6,0 69.9,5.3 75.6,13.5 78.5,17.8 82.3,21.5 86.6,24.5 94.7,30.1 100,39.4 100,50 100,60.6 94.7,69.9 86.5,75.6 82.2,78.5 78.5,82.3 75.5,86.6 69.9,94.7 60.6,100 50,100 39.4,100 30.1,94.7 24.4,86.5 21.5,82.2 17.7,78.5 13.4,75.5 5.3,69.9 0,60.6 0,50 0,39.4 5.3,30.1 13.5,24.4 17.8,21.5 21.5,17.7 24.5,13.4 30.1,5.3 39.4,0 50,0 Z", + ) + + object Heart : PathBased( + key = "heart", + svgPathString = "M50,20 C45,0 30,0 25,0 20,0 0,5 0,34 0,72 40,97 50,100 60,97 100,72 100,34 100,5 80,0 75,0 70,0 55,0 50,20 Z", + ) + + object Leaf : PathBased( + key = "leaf", + svgPathString = "M-0.06,0.07h67.37C85.36,0.07,100,14.71,100,32.76v67.37H32.63c-18.06,0-32.69-14.64-32.69-32.69L-0.06,0.07z", + ) + + object Meow : PathBased( + key = "meow", + svgPathString = "M 4.432 31.65 C 4.656 31.126 4.736 30.551 4.663 29.985 C 4.026 26.269 1.314 11.591 0.116 4.701 C -0.235 2.992 0.443 0.912 1.895 0.145 C 2.336 -0.072 2.839 -0.014 3.293 0.112 C 4.378 0.473 5.381 1.08 6.357 1.718 C 10.502 4.416 14.621 7.167 18.732 9.933 C 19.823 10.666 21.252 10.658 22.334 9.911 C 30.185 4.6 39.651 1.503 49.833 1.503 C 60.18 1.503 69.786 4.701 77.716 10.161 C 78.797 10.922 80.235 10.937 81.331 10.199 C 86.109 6.997 90.875 3.776 95.646 0.564 C 96.99 -0.438 99.098 0.259 99.76 1.907 C 100.193 3.164 99.88 4.529 99.634 5.789 C 98.325 13.019 95.754 27.409 95.207 30.68 C 95.169 31.181 95.249 31.684 95.441 32.148 C 97.788 37.889 99.082 44.17 99.082 50.752 C 99.082 77.932 77.014 100 49.833 100 C 22.653 100 0.585 77.932 0.585 50.752 C 0.585 43.98 1.955 37.526 4.432 31.65 Z", + ) + + object Pebble : PathBased( + key = "pebble", + svgPathString = "M55,0 C25,0 0,25 0,50 0,78 28,100 55,100 85,100 100,85 100,58 100,30 86,0 55,0 Z", + ) + + object RoundedHexagon : PathBased( + key = "roundedhexagon", + svgPathString = "M4.8 33V67c0 5.8 3 11 8 13.7l29.4 17c4.9 2.7 11 2.7 15.9 0l29.4 -17c4.9 -2.7 8 -8 8 -13.7V33c0 -5.8 -3 -11 -8 -13.7l-29.4 -17c-4.9 -2.7 -11 -2.7 -15.9 0l-29.7 17C7.8 22.2 4.8 27.5 4.8 33z", + ) + + object Stretched : PathBased( + key = "stretched", + svgPathString = "M100,50 C100,77 77,100 50,100 L10,100 C4,100 0,96 0,90 L0,50 C0,22 22,0 50,0 L90,0 C96,0 100,4 100,10 L100,50 Z", + ) + + object Vessel : PathBased( + key = "vessel", + svgPathString = "M12.97,0 C8.41,0 4.14,2.55 2.21,6.68 -1.03,13.61 -0.71,21.78 3.16,28.46 4.89,31.46 4.89,35.2 3.16,38.2 -1.05,45.48 -1.05,54.52 3.16,61.8 4.89,64.8 4.89,68.54 3.16,71.54 -0.71,78.22 -1.03,86.39 2.21,93.32 4.14,97.45 8.41,100 12.97,100 21.38,100 78.62,100 87.03,100 91.59,100 95.85,97.45 97.79,93.32 101.02,86.39 100.71,78.22 96.84,71.54 95.1,68.54 95.1,64.8 96.84,61.8 101.05,54.52 101.05,45.48 96.84,38.2 95.1,35.2 95.1,31.46 96.84,28.46 100.71,21.78 101.02,13.61 97.79,6.68 95.85,2.55 91.59,0 87.03,0 78.62,0 21.38,0 12.97,0 Z", + ) + companion object { /** @@ -478,6 +525,15 @@ sealed class IconShape { "foursidedcookie" -> FourSidedCookie "sevensidedcookie" -> SevenSidedCookie "arch" -> Arch + "cloudy" -> Cloudy + "flower" -> Flower + "heart" -> Heart + "leaf" -> Leaf + "meow" -> Meow + "pebble" -> Pebble + "roundedhexagon" -> RoundedHexagon + "stretched" -> Stretched + "vessel" -> Vessel "" -> null else -> CustomCornerBased.fromStringOrNull(value) } diff --git a/lawnchair/src/app/lawnchair/ui/preferences/destinations/IconShapePreference.kt b/lawnchair/src/app/lawnchair/ui/preferences/destinations/IconShapePreference.kt index 3338097073..877c45a857 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/destinations/IconShapePreference.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/destinations/IconShapePreference.kt @@ -96,6 +96,15 @@ fun iconShapeEntries(context: Context): List> { ListPreferenceEntry(IconShape.FourSidedCookie) { stringResource(id = R.string.icon_shape_four_sided_cookie) }, ListPreferenceEntry(IconShape.SevenSidedCookie) { stringResource(id = R.string.icon_shape_seven_sided_cookie) }, ListPreferenceEntry(IconShape.Arch) { stringResource(id = R.string.icon_shape_arch) }, + ListPreferenceEntry(IconShape.Cloudy) { stringResource(id = R.string.icon_shape_cloudy) }, + ListPreferenceEntry(IconShape.Flower) { stringResource(id = R.string.icon_shape_flower) }, + ListPreferenceEntry(IconShape.Heart) { stringResource(id = R.string.icon_shape_heart) }, + ListPreferenceEntry(IconShape.Leaf) { stringResource(id = R.string.icon_shape_leaf) }, + ListPreferenceEntry(IconShape.Meow) { stringResource(id = R.string.icon_shape_meow) }, + ListPreferenceEntry(IconShape.Pebble) { stringResource(id = R.string.icon_shape_pebble) }, + ListPreferenceEntry(IconShape.RoundedHexagon) { stringResource(id = R.string.icon_shape_roundedhexagon) }, + ListPreferenceEntry(IconShape.Stretched) { stringResource(id = R.string.icon_shape_stretched) }, + ListPreferenceEntry(IconShape.Vessel) { stringResource(id = R.string.icon_shape_vessel) }, ) }