Fix UISettings.fontScale property access modifier

To make available as bean property.
This commit is contained in:
Anton Tarasov
2017-03-13 13:17:13 +03:00
parent 1c78cd0ca4
commit 745930b309
@@ -57,7 +57,7 @@ class UISettings : BaseState(), PersistentStateComponent<UISettings> {
@get:Property(filter = FontFilter::class)
@get:OptionTag("FONT_SCALE")
private var fontScale by storedProperty(0f)
var fontScale by storedProperty(0f)
@get:OptionTag("RECENT_FILES_LIMIT") var recentFilesLimit by storedProperty(50)
@get:OptionTag("CONSOLE_COMMAND_HISTORY_LIMIT") var consoleCommandHistoryLimit by storedProperty(300)
@@ -197,10 +197,11 @@ class UISettings : BaseState(), PersistentStateComponent<UISettings> {
override fun accepts(accessor: Accessor, bean: Any): Boolean {
val settings = bean as UISettings
val fontData = systemFontFaceAndSize
if ("FONT_FACE" == accessor.name) {
if ("fontFace" == accessor.name) {
return fontData.first != settings.fontFace
}
// store only in pair
// fontSize/fontScale should either be stored in pair or not stored at all
// otherwise the fontSize restore logic gets broken (see loadState)
return !(fontData.second == settings.fontSize && 1f == settings.fontScale)
}
}
@@ -236,7 +237,7 @@ class UISettings : BaseState(), PersistentStateComponent<UISettings> {
else {
fontSize = JBUI.scale(fontSize / fontScale).toInt()
}
fontScale = JBUI.scale(1f)
fontScale = JBUI.scale(1f) // at this moment JBUI.scale only depends on the HiDPI mode and the system scale
initDefFont()
// 1. Sometimes system font cannot display standard ASCII symbols. If so we have