feat: add support for UI scaling via TERMORA_SCALE environment variable

This commit is contained in:
hstyi
2025-11-07 09:23:01 +08:00
committed by hstyi
parent 6ec526eeeb
commit 026b13ba05

View File

@@ -50,6 +50,17 @@ class ApplicationInitializr {
}
}
// https://github.com/TermoraDev/termora/issues/1254
if (System.getProperty(FlatSystemProperties.UI_SCALE).isNullOrBlank()) {
val scale = System.getenv("TERMORA_SCALE")
if (scale.isNullOrBlank().not()) {
if (NumberUtils.toDouble(scale, -1.0) > 0) {
System.setProperty(FlatSystemProperties.UI_SCALE_ENABLED, "true")
System.setProperty(FlatSystemProperties.UI_SCALE, scale)
}
}
}
// 启动
val runtime = measureTimeMillis { ApplicationRunner().run() }
val log = LoggerFactory.getLogger(javaClass)