Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master' into auto-r…
Browse files Browse the repository at this point in the history
…emoval-of-old-snapshots
  • Loading branch information
MykytaPimonovTD committed Oct 25, 2024
2 parents d09d790 + 246b04a commit 878ba98
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ package io.spine.internal.dependency

// https://github.com/spine-examples/Pingh
public object Pingh {
private const val version = "1.0.0-SNAPSHOT.11"
private const val version = "1.0.0-SNAPSHOT.12"
private const val group = "io.spine.examples.pingh"

public const val client: String = "$group:client:$version"
Expand Down
30 changes: 19 additions & 11 deletions desktop/src/main/kotlin/io/spine/examples/pingh/desktop/Window.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,23 @@ import io.spine.examples.pingh.client.PinghApplication
*
* @param state The state of the application window.
* @param app Manages the logic for the Pingh app.
* @param uriHandler The `CompositionLocal` that provides functionality for handling URL,
* such as opening a URI.
* @param uriHandler Provides functionality for handling URL, such as opening a URI.
* @see [PlatformWindow]
*/
@Composable
internal fun Window(
state: WindowState,
app: PinghApplication,
uriHandler: UriHandler = LocalUriHandler.current
uriHandler: UriHandler? = null
) {
PlatformWindow(
title = state.title,
isShown = state.isShown,
onClose = state::hide
) {
CompositionLocalProvider(LocalUriHandler provides uriHandler) {
Box(
modifier = Modifier
.fillMaxSize()
.clip(MaterialTheme.shapes.small)
) {
CurrentPage(app)
}
val localUriHandler = uriHandler ?: LocalUriHandler.current
CompositionLocalProvider(LocalUriHandler provides localUriHandler) {
WindowContent(app)
}
}
}
Expand Down Expand Up @@ -111,6 +105,20 @@ private fun PlatformWindow(
)
}

/**
* Displays a content in the Pingh window.
*/
@Composable
private fun WindowContent(app: PinghApplication) {
Box(
modifier = Modifier
.fillMaxSize()
.clip(MaterialTheme.shapes.small)
) {
CurrentPage(app)
}
}

/**
* State of [Window].
*/
Expand Down
2 changes: 1 addition & 1 deletion version.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
/**
* The version of the `Pingh` to publish.
*/
val pinghVersion: String by extra("1.0.0-SNAPSHOT.11")
val pinghVersion: String by extra("1.0.0-SNAPSHOT.12")

0 comments on commit 878ba98

Please sign in to comment.