Skip to content

Commit 1cd9ef5

Browse files
authored
Merge pull request #35 from mori-atsushi/desktop-example
Add desktop example
2 parents 798d679 + e693c72 commit 1cd9ef5

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

example/build.gradle.kts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ kotlin {
2626
}
2727
}
2828

29+
jvm("desktop")
30+
2931
sourceSets {
3032
val commonMain by getting {
3133
dependencies {
@@ -59,6 +61,13 @@ kotlin {
5961
val uikitSimArm64Main by getting {
6062
dependsOn(uikitMain)
6163
}
64+
val desktopMain by getting {
65+
dependsOn(commonMain)
66+
67+
dependencies {
68+
implementation(compose.desktop.currentOs)
69+
}
70+
}
6271
}
6372
}
6473

@@ -88,6 +97,10 @@ compose {
8897
}
8998
}
9099
}
100+
101+
desktop.application {
102+
mainClass = "Main_desktopKt"
103+
}
91104
}
92105

93106
android {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import androidx.compose.ui.unit.dp
2+
import androidx.compose.ui.window.Window
3+
import androidx.compose.ui.window.application
4+
import androidx.compose.ui.window.rememberWindowState
5+
import com.moriatsushi.insetsx.example.ExampleApp
6+
7+
fun main() = application {
8+
Window(
9+
title = "InsetsX",
10+
state = rememberWindowState(width = 600.dp, height = 800.dp),
11+
onCloseRequest = ::exitApplication
12+
) {
13+
ExampleApp()
14+
}
15+
}

0 commit comments

Comments
 (0)