Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency org.jetbrains.compose to v1.7.0 #129

Merged
merged 6 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading