Browse Source
When users run/package application we will configure Compose to work as standalone application. It means we will override some global Swing properties in Compose initialization function: - sets system property `apple.laf.useScreenMenuBar` to true - sets system property `sun.java2d.uiScale`/`sun.java2d.uiScale.enabled` automatically on Linux - sets UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()) When users don't use those tasks (when they use Compose in an existing Swing application, or in an IDEA plugin), this property will not be set, and so we will not override Swing globals.pull/838/head
Igor Demin
3 years ago
committed by
GitHub
9 changed files with 132 additions and 2 deletions
@ -0,0 +1,30 @@
|
||||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat |
||||
|
||||
plugins { |
||||
id "org.jetbrains.kotlin.jvm" |
||||
id "org.jetbrains.compose" |
||||
} |
||||
|
||||
repositories { |
||||
google() |
||||
mavenCentral() |
||||
maven { |
||||
url "https://maven.pkg.jetbrains.space/public/p/compose/dev" |
||||
} |
||||
} |
||||
|
||||
dependencies { |
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib" |
||||
implementation compose.desktop.currentOs |
||||
} |
||||
|
||||
compose.desktop { |
||||
application { |
||||
mainClass = "MainKt" |
||||
nativeDistributions { |
||||
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) |
||||
packageVersion = "1.0.0" |
||||
packageName = "Test Package" |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,10 @@
|
||||
pluginManagement { |
||||
plugins { |
||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' |
||||
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' |
||||
} |
||||
repositories { |
||||
mavenLocal() |
||||
gradlePluginPortal() |
||||
} |
||||
} |
@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) { |
||||
println("compose.application.configure.swing.globals=${java.lang.System.getProperty("compose.application.configure.swing.globals")}") |
||||
} |
@ -0,0 +1,32 @@
|
||||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat |
||||
|
||||
plugins { |
||||
id "org.jetbrains.kotlin.jvm" |
||||
id "org.jetbrains.compose" |
||||
} |
||||
|
||||
repositories { |
||||
google() |
||||
mavenCentral() |
||||
maven { |
||||
url "https://maven.pkg.jetbrains.space/public/p/compose/dev" |
||||
} |
||||
} |
||||
|
||||
dependencies { |
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib" |
||||
implementation compose.desktop.currentOs |
||||
} |
||||
|
||||
compose.desktop { |
||||
application { |
||||
mainClass = "MainKt" |
||||
nativeDistributions { |
||||
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) |
||||
packageVersion = "1.0.0" |
||||
packageName = "Test Package" |
||||
|
||||
jvmArgs("-Dcompose.application.configure.swing.globals=false") |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,10 @@
|
||||
pluginManagement { |
||||
plugins { |
||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' |
||||
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' |
||||
} |
||||
repositories { |
||||
mavenLocal() |
||||
gradlePluginPortal() |
||||
} |
||||
} |
Loading…
Reference in new issue