diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..7440a49
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/conveyor.conf b/conveyor.conf
index 5337dc8..24551c9 100644
--- a/conveyor.conf
+++ b/conveyor.conf
@@ -3,7 +3,7 @@ include "#!./gradlew -q printConveyorConfig"
app {
fsname = hematoma
display-name = HEMAtoma
- icons = icon.svg
+ icons = desktop-app/src/main/composeResources/drawable/icon.svg
linux.inputs += TASK/rendered-icons/linux
windows.inputs += TASK/rendered-icons/windows
diff --git a/desktop-app/build.gradle.kts b/desktop-app/build.gradle.kts
index 076d85e..4932fd6 100644
--- a/desktop-app/build.gradle.kts
+++ b/desktop-app/build.gradle.kts
@@ -19,6 +19,7 @@ dependencies {
"windowsAmd64"(compose.desktop.windows_x64)
implementation(compose.material3)
implementation(compose.materialIconsExtended)
+ implementation(compose.components.resources)
implementation(libs.filekit)
implementation(libs.datatable)
@@ -50,6 +51,10 @@ compose.desktop {
}
}
+compose.resources {
+ packageOfResClass = "info.marozzo.hematoma.resources"
+}
+
detekt {
buildUponDefaultConfig = true
basePath = rootProject.layout.projectDirectory.toString()
diff --git a/desktop-app/src/main/composeResources/drawable/icon.svg b/desktop-app/src/main/composeResources/drawable/icon.svg
new file mode 100644
index 0000000..f7d5727
--- /dev/null
+++ b/desktop-app/src/main/composeResources/drawable/icon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/desktop-app/src/main/kotlin/info/marozzo/hematoma/Main.kt b/desktop-app/src/main/kotlin/info/marozzo/hematoma/Main.kt
index 407abad..2b3a511 100644
--- a/desktop-app/src/main/kotlin/info/marozzo/hematoma/Main.kt
+++ b/desktop-app/src/main/kotlin/info/marozzo/hematoma/Main.kt
@@ -7,6 +7,7 @@
package info.marozzo.hematoma
import androidx.compose.animation.AnimatedContent
+import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
@@ -31,8 +32,11 @@ import com.google.common.flogger.FluentLogger
import info.marozzo.hematoma.components.*
import info.marozzo.hematoma.contract.EventState
import info.marozzo.hematoma.contract.Screen
+import info.marozzo.hematoma.resources.Res
+import info.marozzo.hematoma.resources.icon
import info.marozzo.hematoma.shortcuts.handler
import info.marozzo.hematoma.shortcuts.shortcuts
+import org.jetbrains.compose.resources.painterResource
import java.awt.Dimension
import java.nio.file.Paths
import kotlin.io.path.exists
@@ -48,7 +52,7 @@ fun main() = SuspendApp {
awaitApplication {
val coroutineScope = rememberCoroutineScope()
val snackbar = remember { SnackbarHostState() }
- val icon = rememberAppIcon()
+ val icon = painterResource(Res.drawable.icon)
val vm = remember(coroutineScope) { EventViewModel(coroutineScope, snackbar) }
val state by vm.observeStates().collectAsState()
@@ -98,13 +102,3 @@ fun App(state: EventState) = MaterialTheme {
}
}
}
-
-@Composable
-fun rememberAppIcon(density: Density = LocalDensity.current): Painter? = remember {
- System.getProperty("app.dir")
- ?.let { Paths.get(it, "icon.svg") }
- ?.takeIf { it.exists() }
- ?.inputStream()
- ?.use { loadSvgPainter(it, density) }
-}
-
diff --git a/desktop-app/src/main/kotlin/info/marozzo/hematoma/components/Competitors.kt b/desktop-app/src/main/kotlin/info/marozzo/hematoma/components/Competitors.kt
index 091c9fe..61c34f6 100644
--- a/desktop-app/src/main/kotlin/info/marozzo/hematoma/components/Competitors.kt
+++ b/desktop-app/src/main/kotlin/info/marozzo/hematoma/components/Competitors.kt
@@ -132,7 +132,7 @@ fun CompetitorSelect(
onExpandedChange = { setExpanded(it) },
) {
TextField(
- modifier = Modifier.menuAnchor(),
+ modifier = Modifier.menuAnchor(type = MenuAnchorType.PrimaryEditable),
singleLine = true,
value = input,
onValueChange = { setInput(it) },
diff --git a/desktop-app/src/main/kotlin/info/marozzo/hematoma/components/Header.kt b/desktop-app/src/main/kotlin/info/marozzo/hematoma/components/Header.kt
index 2c054df..071e288 100644
--- a/desktop-app/src/main/kotlin/info/marozzo/hematoma/components/Header.kt
+++ b/desktop-app/src/main/kotlin/info/marozzo/hematoma/components/Header.kt
@@ -40,7 +40,7 @@ private fun FileMenu(hasPath: Boolean, modifier: Modifier = Modifier) {
Button(
onClick = { setExpanded(!expanded) },
shape = RoundedCornerShape(0.dp),
- modifier = Modifier.menuAnchor(),
+ modifier = Modifier.menuAnchor(type = MenuAnchorType.PrimaryNotEditable),
) {
Text("File")
}
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index d2ec4ed..3073190 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -3,7 +3,7 @@
[versions]
kotlin = "2.0.21"
ksp = "2.0.21-1.0.25"
-compose = "1.6.11"
+compose = "1.7.0"
kotlinx-coroutines = "1.9.0"
kotlinx-serialization = "1.7.3"
kotlinx-immutable-collections = "0.3.8"
diff --git a/icon.svg b/icon.svg
deleted file mode 100644
index bf9a1ae..0000000
--- a/icon.svg
+++ /dev/null
@@ -1,22499 +0,0 @@
-
-
-
-