From 745930b309dcda8b379b017f2ef73910c96bc4e4 Mon Sep 17 00:00:00 2001 From: Anton Tarasov Date: Mon, 13 Mar 2017 13:13:17 +0300 Subject: [PATCH] Fix UISettings.fontScale property access modifier To make available as bean property. --- .../editor-ui-api/src/com/intellij/ide/ui/UISettings.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.kt b/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.kt index 82af5eefc5fb..66152624f082 100644 --- a/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.kt +++ b/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.kt @@ -57,7 +57,7 @@ class UISettings : BaseState(), PersistentStateComponent { @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 { 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 { 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