Skip to content

Commit

Permalink
Add static initialize to FluentApp
Browse files Browse the repository at this point in the history
This should be called before calling any JavaFX code. It loads the
FluentLib DLL, and does some additional setup (might be extended in the
future); most notably, it will do the "non-AMD GPU fix" automatically.
  • Loading branch information
Eroica committed May 3, 2024
1 parent 267e58d commit f9ca32a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion theme/src/main/kotlin/earth/groundctrl/fluent/FluentApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,23 @@ abstract class FluentApp(
private val useMica: Boolean = false,
private val useHeaderBar: Boolean = false
) : Application() {
companion object {
@JvmStatic
fun initialize(isFixMica: Boolean = true) {
System.loadLibrary("FluentLib")
System.setProperty("prism.lcdtext", "false")

if (isFixMica && !Windows.isAmdGpu()) {
System.setProperty("prism.forceUploadingPainter", "true")
System.setProperty("javafx.animation.fullspeed", "true")
}
}
}

abstract fun onCreateStage(primaryStage: Stage)

override fun init() {
super.init()
System.loadLibrary("FluentLib")
setUserAgentStylesheet("fluent-light.css")
}

Expand Down

0 comments on commit f9ca32a

Please sign in to comment.