All Downloads are FREE. Search and download functionalities are using the official Maven repository.

desktopMain.org.jetbrains.compose.resources.ResourceEnvironment.desktop.kt Maven / Gradle / Ivy

There is a newer version: 1.8.0-alpha01
Show newest version
package org.jetbrains.compose.resources

import org.jetbrains.skiko.SystemTheme
import org.jetbrains.skiko.currentSystemTheme
import java.awt.Toolkit
import java.util.*

internal actual fun getSystemEnvironment(): ResourceEnvironment {
    val locale = Locale.getDefault()
    //FIXME: don't use skiko internals
    val isDarkTheme = currentSystemTheme == SystemTheme.DARK
    val dpi = Toolkit.getDefaultToolkit().screenResolution
    return ResourceEnvironment(
        language = LanguageQualifier(locale.language),
        region = RegionQualifier(locale.country),
        theme = ThemeQualifier.selectByValue(isDarkTheme),
        density = DensityQualifier.selectByValue(dpi)
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy