Skip to content

Commit

Permalink
Merge pull request #129 from recke96/renovate/compose
Browse files Browse the repository at this point in the history
Update dependency org.jetbrains.compose to v1.7.0
  • Loading branch information
recke96 authored Oct 20, 2024
2 parents 69d3b4b + 1f4265d commit fd058e9
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 22,514 deletions.
8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion conveyor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions desktop-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -50,6 +51,10 @@ compose.desktop {
}
}

compose.resources {
packageOfResClass = "info.marozzo.hematoma.resources"
}

detekt {
buildUponDefaultConfig = true
basePath = rootProject.layout.projectDirectory.toString()
Expand Down
1 change: 1 addition & 0 deletions desktop-app/src/main/composeResources/drawable/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 5 additions & 11 deletions desktop-app/src/main/kotlin/info/marozzo/hematoma/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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()

Expand Down Expand Up @@ -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) }
}

Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading

0 comments on commit fd058e9

Please sign in to comment.