mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-16 02:12:58 +08:00
feat: add support for UI scaling via TERMORA_SCALE environment variable
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user