Skip to content

Commit

Permalink
Merge pull request #35 from mori-atsushi/desktop-example
Browse files Browse the repository at this point in the history
Add desktop example
  • Loading branch information
mori-atsushi authored May 19, 2023
2 parents 798d679 + e693c72 commit 1cd9ef5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
13 changes: 13 additions & 0 deletions example/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ kotlin {
}
}

jvm("desktop")

sourceSets {
val commonMain by getting {
dependencies {
Expand Down Expand Up @@ -59,6 +61,13 @@ kotlin {
val uikitSimArm64Main by getting {
dependsOn(uikitMain)
}
val desktopMain by getting {
dependsOn(commonMain)

dependencies {
implementation(compose.desktop.currentOs)
}
}
}
}

Expand Down Expand Up @@ -88,6 +97,10 @@ compose {
}
}
}

desktop.application {
mainClass = "Main_desktopKt"
}
}

android {
Expand Down
15 changes: 15 additions & 0 deletions example/src/desktopMain/kotlin/Main.desktop.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import androidx.compose.ui.window.rememberWindowState
import com.moriatsushi.insetsx.example.ExampleApp

fun main() = application {
Window(
title = "InsetsX",
state = rememberWindowState(width = 600.dp, height = 800.dp),
onCloseRequest = ::exitApplication
) {
ExampleApp()
}
}

0 comments on commit 1cd9ef5

Please sign in to comment.