Skip to content

Commit

Permalink
Explicit language selection was broken in 5,8
Browse files Browse the repository at this point in the history
  • Loading branch information
ingokegel committed Jul 8, 2021
1 parent b7b8830 commit 4f3e196
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions modules/browser/src/main/kotlin/browser/DarkModeOption.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@ package org.gjt.jclasslib.browser
import com.install4j.api.UiUtil
import org.gjt.jclasslib.browser.BrowserBundle.getString

enum class DarkModeOption(val displayName: String) {
AUTO(getString("menu.dark.mode.auto")) {
enum class DarkModeOption {
AUTO() {
override val displayName get() = getString("menu.dark.mode.auto")
override fun isDarkMode() = UiUtil.isDarkDesktop()
},
ON(getString("menu.dark.mode.on")) {
ON() {
override val displayName get() = getString("menu.dark.mode.on")
override fun isDarkMode() = true
},
OFF(getString("menu.dark.mode.off")) {
OFF() {
override val displayName get() = getString("menu.dark.mode.off")
override fun isDarkMode() = false
};

// Cannot be a constructor parameter because the class is used in Main.kt
abstract val displayName: String
abstract fun isDarkMode(): Boolean
}

0 comments on commit 4f3e196

Please sign in to comment.