Add more strings and improve launcher icon

This commit is contained in:
Christian Basler
2025-03-18 18:24:04 +01:00
parent 54c22beddc
commit c27e4a7f6f
6 changed files with 348 additions and 84 deletions

View File

@@ -1,4 +1,76 @@
<resources>
<string name="app_name">YAEP</string>
<string name="app_name_full">Yet Another Einstein Puzzle</string>
<string name="solved">Congratulations! You solved the puzzle in %1$s</string>
<string name="restart">Restart</string>
<!-- Animals -->
<string name="zebra">Zebra</string>
<string name="octopus">Octopus</string>
<string name="goat">Goat</string>
<string name="sloth">Sloth</string>
<string name="dog">Dog</string>
<string name="snail">Snail</string>
<string name="ant">Ant</string>
<!-- Desserts -->
<string name="ice_cream">Ice Cream</string>
<string name="doughnut">Doughnut</string>
<string name="cookie">Cookie</string>
<string name="cake">Cake</string>
<string name="cupcake">Cupcake</string>
<string name="pie">Pie</string>
<string name="chocolate">Chocolate</string>
<string name="lollipop">Lollipop</string>
<string name="custard">Custard</string>
<!-- Drinks -->
<string name="milk">Milk</string>
<string name="wine">Wine</string>
<string name="cocktail">Cocktail</string>
<string name="coffee">Coffee</string>
<string name="tea">Tea</string>
<string name="beer">Beer</string>
<string name="beverage">Beverage</string>
<!-- Fruits -->
<string name="banana">Banana</string>
<string name="cherries">Cherries</string>
<string name="grapes">Grapes</string>
<string name="kiwi">Kiwi</string>
<string name="lemon">Lemon</string>
<string name="mango">Mango</string>
<string name="pear">Pear</string>
<string name="pineapple">Pineapple</string>
<string name="strawberry">Strawberry</string>
<string name="watermelon">Watermelon</string>
<!-- Nationalities -->
<string name="canadian">Canadian</string>
<string name="japanese">Japanese</string>
<string name="norwegian">Norwegian</string>
<string name="spanish">Spanish</string>
<string name="swedish">Swedish</string>
<string name="swiss">Swiss</string>
<string name="british">British</string>
<string name="ukrainian">Ukrainian</string>
<!-- Professions -->
<string name="astronaut">Astronaut</string>
<string name="health_worker">Health_worker</string>
<string name="farmer">Farmer</string>
<string name="rock_star">Rock_star</string>
<string name="scientist">Scientist</string>
<string name="software_dev">Software_dev</string>
<string name="firefighter">Firefighter</string>
<string name="teacher">Teacher</string>
<!-- Transportation -->
<string name="bicycle">Bicycle</string>
<string name="motor_scooter">Motor Scooter</string>
<string name="skateboard">Skateboard</string>
<string name="taxi">Taxi</string>
<string name="locomotive">Locomotive</string>
<string name="tram_car">Tram Car</string>
<string name="bus">Bus</string>
</resources>

View File

@@ -101,7 +101,7 @@ fun App(modifier: Modifier = Modifier) {
Text(time, fontSize = TextUnit(4f, TextUnitType.Em))
}
}
EndOfGame(isSolved = isSolved) {
EndOfGame(isSolved = isSolved, time = time) {
game = generateGame()
}
}

View File

@@ -18,11 +18,16 @@ import androidx.compose.ui.graphics.BlurEffect
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.sp
import org.jetbrains.compose.resources.stringResource
import yaep.commonui.generated.resources.Res
import yaep.commonui.generated.resources.restart
import yaep.commonui.generated.resources.solved
@Composable
fun EndOfGame(
modifier: Modifier = Modifier,
isSolved: Boolean,
time: String,
onRestart: () -> Unit
) {
AnimatedVisibility(
@@ -43,7 +48,7 @@ fun EndOfGame(
.align(Alignment.Center)
) {
Text(
text = "You won",
text = stringResource(Res.string.solved, time),
fontSize = 128.sp,
textAlign = TextAlign.Center,
)
@@ -51,7 +56,7 @@ fun EndOfGame(
modifier = Modifier.align(CenterHorizontally),
onClick = onRestart
) {
Text("Restart")
Text(stringResource(Res.string.restart))
}
}
}

View File

@@ -0,0 +1,163 @@
package ch.dissem.yaep.ui.common
import ch.dissem.yaep.domain.Animal
import ch.dissem.yaep.domain.Dessert
import ch.dissem.yaep.domain.Drink
import ch.dissem.yaep.domain.Fruit
import ch.dissem.yaep.domain.ItemClass
import ch.dissem.yaep.domain.Nationality
import ch.dissem.yaep.domain.Profession
import ch.dissem.yaep.domain.Transportation
import org.jetbrains.compose.resources.StringResource
import yaep.commonui.generated.resources.Res
import yaep.commonui.generated.resources.ant
import yaep.commonui.generated.resources.astronaut
import yaep.commonui.generated.resources.banana
import yaep.commonui.generated.resources.beer
import yaep.commonui.generated.resources.beverage
import yaep.commonui.generated.resources.bicycle
import yaep.commonui.generated.resources.british
import yaep.commonui.generated.resources.bus
import yaep.commonui.generated.resources.cake
import yaep.commonui.generated.resources.canadian
import yaep.commonui.generated.resources.cherries
import yaep.commonui.generated.resources.chocolate
import yaep.commonui.generated.resources.cocktail
import yaep.commonui.generated.resources.coffee
import yaep.commonui.generated.resources.cookie
import yaep.commonui.generated.resources.cupcake
import yaep.commonui.generated.resources.custard
import yaep.commonui.generated.resources.dog
import yaep.commonui.generated.resources.doughnut
import yaep.commonui.generated.resources.farmer
import yaep.commonui.generated.resources.firefighter
import yaep.commonui.generated.resources.goat
import yaep.commonui.generated.resources.grapes
import yaep.commonui.generated.resources.health_worker
import yaep.commonui.generated.resources.ice_cream
import yaep.commonui.generated.resources.japanese
import yaep.commonui.generated.resources.kiwi
import yaep.commonui.generated.resources.lemon
import yaep.commonui.generated.resources.locomotive
import yaep.commonui.generated.resources.lollipop
import yaep.commonui.generated.resources.mango
import yaep.commonui.generated.resources.milk
import yaep.commonui.generated.resources.motor_scooter
import yaep.commonui.generated.resources.norwegian
import yaep.commonui.generated.resources.octopus
import yaep.commonui.generated.resources.pear
import yaep.commonui.generated.resources.pie
import yaep.commonui.generated.resources.pineapple
import yaep.commonui.generated.resources.rock_star
import yaep.commonui.generated.resources.scientist
import yaep.commonui.generated.resources.skateboard
import yaep.commonui.generated.resources.sloth
import yaep.commonui.generated.resources.snail
import yaep.commonui.generated.resources.software_dev
import yaep.commonui.generated.resources.spanish
import yaep.commonui.generated.resources.strawberry
import yaep.commonui.generated.resources.swedish
import yaep.commonui.generated.resources.swiss
import yaep.commonui.generated.resources.taxi
import yaep.commonui.generated.resources.tea
import yaep.commonui.generated.resources.teacher
import yaep.commonui.generated.resources.tram_car
import yaep.commonui.generated.resources.ukrainian
import yaep.commonui.generated.resources.watermelon
import yaep.commonui.generated.resources.wine
import yaep.commonui.generated.resources.zebra
val ItemClass<*>.localName: StringResource
get() = when (this) {
is Animal -> this.stringResource
is Dessert -> this.stringResource
is Drink -> this.stringResource
is Fruit -> this.stringResource
is Nationality -> this.stringResource
is Profession -> this.stringResource
is Transportation -> this.stringResource
}
private val Animal.stringResource: StringResource
get() = when (this) {
Animal.ZEBRA -> Res.string.zebra
Animal.OCTOPUS -> Res.string.octopus
Animal.GOAT -> Res.string.goat
Animal.SLOTH -> Res.string.sloth
Animal.DOG -> Res.string.dog
Animal.SNAIL -> Res.string.snail
Animal.ANT -> Res.string.ant
}
private val Dessert.stringResource: StringResource
get() = when (this) {
Dessert.ICE_CREAM -> Res.string.ice_cream
Dessert.DOUGHNUT -> Res.string.doughnut
Dessert.COOKIE -> Res.string.cookie
Dessert.CAKE -> Res.string.cake
Dessert.CUPCAKE -> Res.string.cupcake
Dessert.PIE -> Res.string.pie
Dessert.CHOCOLATE -> Res.string.chocolate
Dessert.LOLLIPOP -> Res.string.lollipop
Dessert.CUSTARD -> Res.string.custard
}
private val Drink.stringResource: StringResource
get() = when (this) {
Drink.MILK -> Res.string.milk
Drink.WINE -> Res.string.wine
Drink.COCKTAIL -> Res.string.cocktail
Drink.COFFEE -> Res.string.coffee
Drink.TEA -> Res.string.tea
Drink.BEER -> Res.string.beer
Drink.BEVERAGE -> Res.string.beverage
}
private val Fruit.stringResource: StringResource
get() = when (this) {
Fruit.BANANA -> Res.string.banana
Fruit.CHERRIES -> Res.string.cherries
Fruit.GRAPES -> Res.string.grapes
Fruit.KIWI -> Res.string.kiwi
Fruit.LEMON -> Res.string.lemon
Fruit.MANGO -> Res.string.mango
Fruit.PEAR -> Res.string.pear
Fruit.PINEAPPLE -> Res.string.pineapple
Fruit.STRAWBERRY -> Res.string.strawberry
Fruit.WATERMELON -> Res.string.watermelon
}
private val Nationality.stringResource: StringResource
get() = when (this) {
Nationality.CANADA -> Res.string.canadian
Nationality.JAPAN -> Res.string.japanese
Nationality.NORWAY -> Res.string.norwegian
Nationality.SPAIN -> Res.string.spanish
Nationality.SWEDEN -> Res.string.swedish
Nationality.SWITZERLAND -> Res.string.swiss
Nationality.UNITED_KINGDOM -> Res.string.british
Nationality.UKRAINE -> Res.string.ukrainian
}
private val Profession.stringResource: StringResource
get() = when (this) {
Profession.ASTRONAUT -> Res.string.astronaut
Profession.HEALTH_WORKER -> Res.string.health_worker
Profession.FARMER -> Res.string.farmer
Profession.ROCK_STAR -> Res.string.rock_star
Profession.SCIENTIST -> Res.string.scientist
Profession.SOFTWARE_DEV -> Res.string.software_dev
Profession.FIREFIGHTER -> Res.string.firefighter
Profession.TEACHER -> Res.string.teacher
}
private val Transportation.stringResource: StringResource
get() = when (this) {
Transportation.BICYCLE -> Res.string.bicycle
Transportation.MOTOR_SCOOTER -> Res.string.motor_scooter
Transportation.SKATEBOARD -> Res.string.skateboard
Transportation.TAXI -> Res.string.taxi
Transportation.LOCOMOTIVE -> Res.string.locomotive
Transportation.TRAM_CAR -> Res.string.tram_car
Transportation.BUS -> Res.string.bus
}

View File

@@ -6,23 +6,24 @@
id="Layer_2"
x="0px"
y="0px"
viewBox="0 0 128 128"
style="enable-background:new 0 0 128 128;"
viewBox="0 0 32 32"
xml:space="preserve"
sodipodi:docname="app_icon.svg"
sodipodi:docname="ic_launcher.svg"
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
width="32"
height="32"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs16"><filter
style="color-interpolation-filters:sRGB;"
style="color-interpolation-filters:sRGB"
inkscape:label="Drop Shadow"
id="filter31"
x="-0.032330718"
y="-0.033252865"
width="1.0772906"
height="1.0794951"><feFlood
x="-0.032370995"
y="-0.033195397"
width="1.0773869"
height="1.0793577"><feFlood
result="flood"
in="SourceGraphic"
flood-opacity="0.498039"
@@ -55,11 +56,11 @@
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="0.89453125"
inkscape:cx="119.05677"
inkscape:cy="257.1179"
inkscape:window-width="1920"
inkscape:window-height="1163"
inkscape:zoom="5.0602329"
inkscape:cx="18.47741"
inkscape:cy="88.632284"
inkscape:window-width="2514"
inkscape:window-height="1376"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
@@ -79,63 +80,78 @@
<rect
style="fill:#64bb8b;stroke:none;stroke-width:1.06961;stroke-linecap:round;stroke-linejoin:round;fill-opacity:1"
id="rect16"
width="128"
height="128"
x="0"
y="0"
ry="34.385769" /><g
id="g16"
transform="matrix(0.86689217,0,0,0.86689217,8.5348442,8.6056136)"
style="filter:url(#filter31)"><path
style="fill:#464c4f"
d="m 48.37,30.91 c 0,0 -11.64,-10.14 -12.76,-11.26 -1.13,-1.13 -3.94,-3.19 -3.38,-4.69 0.56,-1.5 9.95,-5.26 16.52,-6.57 6.57,-1.31 20.23,-3.38 32.43,2.25 12.2,5.63 22.01,13.14 30.64,27.03 8.63,13.89 10.91,33.24 11.45,43.92 0.56,11.23 -3.63,27.24 -3.63,27.24 l -1.82,2.79 z"
id="path1" /><path
style="fill:#dfdfe0"
d="m 122.49,94.27 c -0.74,8.26 -2.86,14.73 -2.86,14.73 l -1.5,3.19 L 48.67,31.47 58.78,28.65 45.9,9.09 C 48.33,8.07 53.19,7.12 58.68,7.12 l 6.65,26.11 8.55,-25.09 c 3.7,0.53 9.54,3.27 10.88,4.26 l -12.88,26.82 4.08,1.48 17.1,-23.3 c 2.39,1.23 3.98,2.39 5.84,4.5 l -17.31,22.74 5.63,4.15 17.95,-20.41 c 2.5,2.36 4.29,4.8 6.16,8.41 L 93.63,53.44 97.01,59 116.23,46.33 c 1.16,2.32 1.79,3.84 2.22,6.02 l -19.12,11.36 4.65,5.21 16.61,-9.08 c 0.81,2.18 1.27,4.01 1.37,6.55 l -17.77,8.94 2.96,6.69 15.94,-5.77 c 0.49,2.39 0.53,3.7 0.21,6.05 l -13.55,4.93 3.24,8.09 z"
id="path2" /><path
style="fill:#2f2f2f"
d="m 56.53,27.11 c 0,0 -6.48,0.28 -10.56,3.38 -4.08,3.1 -11.96,11.12 -15.76,15.62 -3.8,4.5 -10,12.67 -10,12.67 l 8.02,24.64 5.07,6.76 c 0,0 9.15,1.27 17.03,-1.27 7.88,-2.53 12.95,-6.19 12.95,-6.19 0,0 -1.55,9.85 -2.82,18.44 -1.27,8.59 -2.86,19.01 -2.16,19.85 0.7,0.84 15.67,1.69 30.88,1.27 15.21,-0.42 29,-1.41 29.7,-2.11 0.7,-0.7 2.82,-20.27 -6.76,-45.19 -9.58,-24.92 -25.74,-36.05 -27.29,-37.03 -1.55,-0.99 -6.05,-3.1 -6.05,-3.1 0,0 0.56,-12.11 -2.82,-18.16 -3.38,-6.05 -4.16,-9.05 -6.34,-9.29 -2.6,-0.28 -7.67,6.26 -9.43,9.01 -2.22,3.46 -3.66,10.7 -3.66,10.7 z"
id="path3" /><path
style="fill:#ffffff"
d="M 22.53,58.86 33.02,45.77 c 0,0 1.62,2.04 -1.13,6.05 -1.83,2.68 -5.98,7.81 -5.98,7.81 z"
id="path4" /><path
style="fill:#ffffff"
d="m 28.47,78.02 c 0,0 10.3,-9.82 16.89,-8.54 8.26,1.6 6.62,15.3 6.62,15.3 0,0 -1.36,0.7 -2.63,1.08 -0.89,0.26 -2.82,0.59 -2.82,0.59 0,0 0.8,-8.52 -2.67,-10.02 -3.47,-1.5 -7.23,0.19 -10.14,1.88 -2.91,1.69 -3.94,2.25 -3.94,2.25 z"
id="path5" /><path
style="fill:#ffffff"
d="m 32.69,85.39 c 0,0 2.25,-2.82 5.07,-2.35 2.82,0.47 2.96,4.32 2.96,4.32 0,0 -2.11,0.14 -3.52,0.14 -1.41,0 -5.16,-0.14 -5.16,-0.14 z"
id="path6" /><path
style="fill:#ffffff"
d="m 28.47,64.04 1.5,5.77 c 0,0 8.49,-10.46 21.02,-6.01 12.53,4.45 7.27,17.55 7.27,17.55 l 3.43,-1.6 c 0,0 1.32,-5.78 0.19,-9.85 -1.5,-5.4 -5.77,-7.88 -4.69,-13.37 1.08,-5.49 2.06,-7.84 2.91,-9.29 0.48,-0.83 2.91,-3.43 4.25,-1.41 2.23,3.36 -1.2,5.12 -0.49,11.36 0.71,6.24 2.61,5.46 4.69,12.76 0.84,2.96 -0.14,9.1 -0.19,10.98 -0.05,1.88 -0.7,5.58 -0.7,5.58 0,0 12.2,-6.89 16.14,-9.67 7.37,-5.19 17.64,-14.55 17.64,-14.55 0,0 -0.44,-1.11 -1.27,-2.39 -0.63,-0.99 -1.22,-1.64 -1.22,-1.64 0,0 -7.53,5.49 -11.1,7.98 -3.57,2.49 -12.88,8.26 -13.68,8.73 -0.8,0.47 -2.2,1.41 -2.58,0.99 -0.63,-0.7 1.29,-5.56 2.18,-8.38 0.89,-2.82 4.95,-13.21 6.31,-16.96 1.36,-3.75 3.52,-8.92 3.52,-8.92 0,0 -1.45,-1.31 -2.44,-1.78 -0.99,-0.47 -3.14,-1.27 -3.14,-1.27 0,0 -2.44,6.19 -3.28,7.51 -0.84,1.31 -2.96,5.4 -4.83,4.04 -1.88,-1.36 -1.83,-7.65 1.41,-11.97 1.73,-2.31 3.8,-3.05 4.08,-9.43 0.28,-6.38 -1.85,-10.51 -2.82,-12.67 -1.08,-2.42 -2.16,-4.46 -3.1,-4.41 -0.94,0.05 -4.15,3.85 -5.56,5.96 -1.27,1.9 -2.42,3.71 -2.98,7.79 -0.56,4.08 -0.61,4.46 -0.61,4.46 l -2.02,0.75 c 0,0 -0.96,10.46 -3.26,12.2 -2.3,1.74 -6.05,1.2 -6.45,-1.78 -0.52,-3.91 -0.33,-7.93 -0.33,-7.93 0,0 -1.5,0.52 -2.53,1.5 -1.03,0.99 -1.83,1.22 -2.67,5.44 -0.84,4.22 -0.91,9.58 -2.82,12.72 -2.11,3.47 -3.94,6.34 -7.32,8.82 -3.38,2.48 -4.46,2.39 -4.46,2.39 z"
id="path7" /><path
style="fill:#ffffff"
d="m 89.76,47.43 c 0,0 -5.33,11.83 -5.16,12.44 0.17,0.61 10.23,-7.46 10.23,-7.46 0,0 -0.97,-1.21 -2.25,-2.63 -1.53,-1.69 -2.82,-2.35 -2.82,-2.35 z"
id="path8" /><path
style="fill:#0b0b0b"
d="m 54.23,53.58 c 0,2.8 -1.08,5.58 -4.22,5.3 -2.34,-0.21 -4.27,-2.5 -4.27,-5.3 0,-2.8 1.9,-5.07 4.25,-5.07 2.35,0 4.24,2.27 4.24,5.07 z"
id="path9" /><path
style="fill:#ffffff"
d="m 63.71,101.51 -0.84,7.67 c 0,0 11.76,-4.43 19.29,-9.36 7.53,-4.93 19.36,-17.25 21.89,-19.99 2.53,-2.74 3.8,-4.65 3.8,-4.65 0,0 -0.46,-1.74 -1.2,-3.24 -0.73,-1.5 -1.62,-2.89 -1.62,-2.89 0,0 -14.64,15.57 -16.68,17.19 -2.04,1.62 -7.81,6.76 -12.18,9.15 -4.36,2.39 -12.46,6.12 -12.46,6.12 z"
id="path10" /><path
style="fill:#ffffff"
d="m 66.88,118.9 c 0.78,-0.78 14.15,-5.84 19.22,-10.35 1.79,-1.59 13.23,-12.32 17.03,-16.61 3.8,-4.29 7.88,-9.08 7.88,-9.08 0,0 0.28,1.41 0.77,3.03 0.48,1.57 0.7,2.75 0.7,2.75 0,0 -4.79,7.25 -7.32,10.49 -2.53,3.24 -8.52,9.71 -10,11.12 -1.48,1.41 -2.96,3.1 -6.9,5.49 -1.4,0.85 -6.62,3.52 -6.62,3.52 0,0 -4.15,0.07 -6.97,0.14 -1.25,0.02 -8.14,-0.15 -7.79,-0.5 z"
id="path11" /><path
style="fill:#ffffff"
d="m 114.46,99.82 c 0,0 -4.15,8.02 -5.56,10.28 -1.41,2.25 -5.56,7.88 -5.56,7.88 0,0 5.7,-0.21 7.67,-0.28 1.97,-0.07 5,-0.35 5,-0.7 0,-0.8 -0.56,-9.08 -0.63,-10.91 -0.07,-1.83 -0.35,-7.32 -0.92,-6.27 z"
id="path12" /><path
style="fill:#454c50"
d="m 68.64,18.45 c -1.48,-0.16 -3.52,4.86 -3.94,7.11 -1.27,6.69 -1.06,9.71 2.6,9.71 4.05,0 3.73,-7.32 3.73,-8.94 0,-1.61 -1.12,-7.74 -2.39,-7.88 z"
id="path13" /><path
style="fill:#464c4f"
d="m 29.88,60 c -2.89,-2.64 -7.41,-3.57 -9.67,-1.22 -2.25,2.35 -3.57,5.35 -5.44,7.32 -1.88,1.97 -5.82,5.35 -7.98,9.95 -2.16,4.6 -3.19,10.61 -0.19,15.58 3,4.97 9.1,8.26 16.61,5.63 7.51,-2.63 10.51,-6.48 10.79,-9.29 0.28,-2.81 0,-6.95 -2.91,-9.29 -1.18,-0.95 -3.28,-2.25 -2.53,-4.04 0.75,-1.79 6.76,-9.66 1.32,-14.64 z"
id="path14" /><path
style="fill:#303030"
d="m 11.11,79.71 c -0.1,1.56 1.92,1.27 2.63,2.72 0.7,1.45 -0.94,4.27 0.89,4.6 1.83,0.33 4.18,-3.28 3.05,-6.71 -1.13,-3.42 -6.43,-2.86 -6.57,-0.61 z"
id="path15" /><path
style="fill:#303030"
d="m 14.23,97.64 c 0,0 5,-2.44 7.25,-4.55 2.19,-2.06 4.32,-4.55 4.83,-5.35 0.52,-0.8 1.6,-2.25 2.53,-1.6 0.94,0.66 0.52,1.83 -0.09,2.72 -0.61,0.89 -2.16,3.1 -4.6,5.35 -2.11,1.95 -3.14,2.44 -4.69,3.28 -1.13,0.61 -2.21,0.7 -2.21,0.7 0,0 -0.88,0.01 -1.79,-0.14 C 15.11,98 14.23,97.64 14.23,97.64 Z"
id="path16" /></g>
<g
id="g1"
transform="scale(0.25)"><rect
style="fill:#64bb8b;fill-opacity:1;stroke:none;stroke-width:1.06961;stroke-linecap:round;stroke-linejoin:round"
id="rect16"
width="128"
height="128"
x="0"
y="0"
ry="34.385769" /><g
id="g16"
transform="matrix(0.86689217,0,0,0.86689217,8.5348442,8.6056136)"
style="filter:url(#filter31)"><path
style="fill:#464c4f"
d="m 48.37,30.91 c 0,0 -11.64,-10.14 -12.76,-11.26 -1.13,-1.13 -3.94,-3.19 -3.38,-4.69 0.56,-1.5 9.970869,-5.1593697 16.52,-6.57 61.24673,-13.1920546 87.03498,66.992265 69.07,103.23 z"
id="path1"
sodipodi:nodetypes="cssscc" /><path
style="fill:#dfdfe0"
d="m 122.80319,94.287388 c -0.55952,4.737883 -1.7556,9.476742 -3.58825,14.216582 L 58.78,28.65 45.9,9.09 C 50.172499,7.9539441 54.430312,7.2672185 58.673441,7.0298231 L 65.33,33.23 73.824086,8.2778223 c 3.944588,0.9298418 7.612394,2.2400637 11.003419,3.9306647 L 71.88,39.22 75.96,40.7 93.154829,17.321488 c 2.030666,1.525255 3.874009,3.08539 5.530028,4.680406 L 81.59,44.64 l 5.63,4.15 17.60648,-20.033392 c 2.18905,2.770551 4.17347,5.673589 5.95327,8.709114 L 93.63,53.44 97.01,59 115.57372,46.917431 c 0.85589,1.980725 1.62329,3.929695 2.3022,5.84691 L 99.33,63.71 l 4.65,5.21 16.1781,-8.818231 c 0.56937,2.125057 1.06545,4.261013 1.48824,6.407868 L 104.19,75.33 l 2.96,6.69 15.8982,-5.810371 c 0.19299,2.146165 0.3103,4.149076 0.35195,6.008735 L 109.75,87.23 l 3.24,8.09 z"
id="path2"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccc" /><path
style="fill:#2f2f2f"
d="m 56.53,27.11 c -9.515632,0.68283 -16.735265,5.918392 -36.32,31.67 3.278036,11.308288 6.065802,22.034403 13.09,31.4 14.754823,1.844912 25.776979,-4.514463 29.98,-7.46 -1.570069,13.010422 -3.421949,25.24918 -4.98,38.29 -0.377505,3.1597 58.73991,1.00009 60.58,-0.84 4.00672,-4.00672 -2.52698,-67.624889 -40.1,-85.32 C 79.488656,14.965582 70.214593,7.4654598 69.62,7.4 69.522198,7.3894675 60.081987,9.8944679 56.53,27.11 Z"
id="path3"
sodipodi:nodetypes="ccccssccc" /><path
style="fill:#ffffff"
d="M 22.53,58.86 33.02,45.77 c 1.819925,2.610936 -1.210179,6.546081 -7.11,13.86 z"
id="path4"
sodipodi:nodetypes="cccc" /><path
style="fill:#ffffff"
d="m 28.47,78.02 c 16.344125,-15.16343 24.960791,-8.079215 23.51,6.76 -2.066549,1.049292 -3.371337,1.310501 -5.45,1.67 1.593813,-13.420769 -5.839561,-12.487267 -16.75,-5.89 z"
id="path5"
sodipodi:nodetypes="ccccc" /><path
style="fill:#ffffff"
d="m 32.69,85.39 c 2.974025,-3.546509 7.702141,-3.296661 8.03,1.97 -3.066857,0.198745 -4.479365,0.154746 -8.68,0 z"
id="path6"
sodipodi:nodetypes="cccc" /><path
style="fill:#ffffff"
d="m 29.97,69.81 c 0,0 8.49,-10.46 21.02,-6.01 12.53,4.45 7.27,17.55 7.27,17.55 l 3.43,-1.6 c 3.134982,-14.516465 -6.072104,-15.228473 -4.5,-23.22 0.988119,-3.902791 1.347111,-10.123287 5.957155,-11.45065 3.973341,0.142932 0.08547,6.596839 0.712845,12.11065 0.984765,8.654834 7.526674,7.780843 3.8,29.32 C 80.153957,80.177213 91.077391,71.622086 101.44,62.29 100.92352,61.019029 99.873769,59.293652 98.95,58.26 79.930936,72.11648 72.049452,76.501362 71.59,75.96 70.906762,75.154956 79.113363,52.72085 83.6,41.7 c -1.739551,-1.553843 -2.447211,-1.879108 -5.58,-3.05 -1.49791,2.87385 -3.62374,12.446811 -8.11,11.55 -1.88,-1.36 -1.83,-7.65 1.41,-11.97 1.73,-2.31 3.8,-3.05 4.08,-9.43 0.406083,-9.252901 -4.874232,-17.135626 -5.92,-17.08 -6.439844,4.086989 -8.193181,11.175358 -9.15,18.21 l -2.02,0.75 c 0,0 -0.96,10.46 -3.26,12.2 -2.3,1.74 -6.05,1.2 -6.45,-1.78 -0.52,-3.91 -0.33,-7.93 -0.33,-7.93 -3.254156,1.181974 -4.495149,3.708555 -5.2,6.94 -0.617081,6.754115 -10.168497,11.485223 -11.988628,22.794533 z"
id="path7"
sodipodi:nodetypes="csccssscccsccccssccsccssc" /><path
style="fill:#ffffff"
d="m 89.76,47.43 c 0,0 -5.33,11.83 -5.16,12.44 0.17,0.61 10.23,-7.46 10.23,-7.46 -3.009379,-3.73527 -4.307475,-4.571497 -5.07,-4.98 z"
id="path8"
sodipodi:nodetypes="cscc" /><path
style="fill:#0b0b0b"
d="m 54.23,53.58 c 0,2.8 -1.08,5.58 -4.22,5.3 -2.34,-0.21 -4.27,-2.5 -4.27,-5.3 0,-2.8 1.9,-5.07 4.25,-5.07 2.35,0 4.24,2.27 4.24,5.07 z"
id="path9" /><path
style="fill:#ffffff"
d="m 63.71,101.51 -0.84,7.67 c 28.972358,-11.093985 43.69859,-32.108673 44.98,-34 -0.57539,-2.121581 -1.50834,-4.063048 -2.82,-6.13 -20.847573,22.144094 -22.952642,23.971573 -41.32,32.46 z"
id="path10"
sodipodi:nodetypes="ccccc" /><path
style="fill:#ffffff"
d="m 66.88,118.9 c 4.883311,-4.88331 10.685214,3.17631 44.13,-36.04 0.47481,2.342723 1.09693,3.835453 1.47,5.78 -8.40359,12.68318 -15.724822,22.84732 -30.84,30.62 -4.826151,0.25674 -9.638547,0.0546 -14.76,-0.36 z"
id="path11"
sodipodi:nodetypes="ccccc" /><path
style="fill:#ffffff"
d="m 114.46,99.82 c -5.1642,9.14719 -5.75663,10.86854 -11.12,18.16 4.86811,-0.11174 9.09144,-0.43841 12.67,-0.98 0.34304,-5.51174 -0.17363,-11.23841 -1.55,-17.18 z"
id="path12"
sodipodi:nodetypes="cccc" /><path
style="fill:#454c50"
d="m 68.64,18.45 c -2.435036,-0.263247 -8.50729,16.82 -1.34,16.82 6.08653,0 3.386055,-16.594451 1.34,-16.82 z"
id="path13"
sodipodi:nodetypes="csc" /><path
style="fill:#464c4f"
d="m 29.88,60 c -2.89,-2.64 -7.41,-3.57 -9.67,-1.22 -2.25,2.35 -3.57,5.35 -5.44,7.32 -7.0250353,6.534018 -13.116568,15.916769 -8.17,25.53 3,4.97 9.1,8.26 16.61,5.63 C 30.72,94.63 33.72,90.78 34,87.97 35.035769,77.575321 27.08491,78.160548 28.56,74.64 29.31,72.85 35.32,64.98 29.88,60 Z"
id="path14"
sodipodi:nodetypes="cccssssc" /><path
style="fill:#303030"
d="m 11.11,79.71 c -0.1,1.56 1.92,1.27 2.63,2.72 0.7,1.45 -0.94,4.27 0.89,4.6 1.83,0.33 4.18,-3.28 3.05,-6.71 -1.13,-3.42 -6.43,-2.86 -6.57,-0.61 z"
id="path15" /><path
style="fill:#303030"
d="m 14.23,97.64 c 0,0 5,-2.44 7.25,-4.55 2.19,-2.06 4.32,-4.55 4.83,-5.35 0.52,-0.8 1.6,-2.25 2.53,-1.6 0.94,0.66 0.52,1.83 -0.09,2.72 -0.61,0.89 -2.16,3.1 -4.6,5.35 -2.11,1.95 -3.14,2.44 -4.69,3.28 -1.13,0.61 -2.21,0.7 -2.21,0.7 0,0 -0.88,0.01 -1.79,-0.14 C 15.11,98 14.23,97.64 14.23,97.64 Z"
id="path16" /></g></g>
</svg>

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@@ -1,5 +1,7 @@
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.window.WindowDraggableArea
@@ -13,6 +15,7 @@ import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.scale
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.WindowPlacement
import androidx.compose.ui.window.WindowScope
@@ -20,14 +23,15 @@ import androidx.compose.ui.window.WindowState
import ch.dissem.yaep.ui.common.theme.AppTheme
import org.jetbrains.compose.resources.painterResource
import org.jetbrains.compose.resources.stringResource
import yaep.commonui.generated.resources.Res
import yaep.commonui.generated.resources.app_name_full
import yaep.commonui.generated.resources.lightbulb
import yaep.commonui.generated.resources.moon
import yaep.commonui.generated.resources.sun
import yaep.commonui.generated.resources.window_close
import yaep.commonui.generated.resources.window_maximize
import yaep.commonui.generated.resources.window_minimize
import yaep.desktop.generated.resources.ic_launcher
import yaep.commonui.generated.resources.Res as CRes
import yaep.desktop.generated.resources.Res as DRes
@Composable
fun WindowScope.DesktopWindow(
@@ -58,9 +62,13 @@ fun AppBar(
) {
TopAppBar(
navigationIcon = {
Icon(painterResource(Res.drawable.lightbulb), null)
Image(
painter = painterResource(DRes.drawable.ic_launcher),
contentDescription = null,
modifier = Modifier.aspectRatio(1f).scale(0.5f),
)
},
title = { Text(text = stringResource(Res.string.app_name_full)) },
title = { Text(text = stringResource(CRes.string.app_name_full)) },
actions = {
Switch(
checked = useDarkMode,
@@ -69,9 +77,9 @@ fun AppBar(
Icon(
painter = painterResource(
if (useDarkMode) {
Res.drawable.sun
CRes.drawable.sun
} else {
Res.drawable.moon
CRes.drawable.moon
}
),
contentDescription = null,
@@ -84,7 +92,7 @@ fun AppBar(
onClick = { windowState.isMinimized = !windowState.isMinimized }
) {
Icon(
painter = painterResource(Res.drawable.window_minimize),
painter = painterResource(CRes.drawable.window_minimize),
contentDescription = null,
modifier = Modifier.size(SwitchDefaults.IconSize),
)
@@ -97,7 +105,7 @@ fun AppBar(
}
) {
Icon(
painter = painterResource(Res.drawable.window_maximize),
painter = painterResource(CRes.drawable.window_maximize),
contentDescription = null,
modifier = Modifier.size(SwitchDefaults.IconSize),
)
@@ -106,7 +114,7 @@ fun AppBar(
onClick = onCloseRequest
) {
Icon(
painter = painterResource(Res.drawable.window_close),
painter = painterResource(CRes.drawable.window_close),
contentDescription = null,
modifier = Modifier.size(SwitchDefaults.IconSize),
)