mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[UI] IDEA-311719, IDEA-311722 Fix togging Compact Mode with zoomed IDE
It didn't work properly before because applying new density values would override those set by the IDE scaler, which would then break later adjustments, leading to incorrect sizes after zooming out or resetting to the default zoom level. GitOrigin-RevId: 722d0a4e4275f1ec6b28c4c2202b429efe59b5bf
This commit is contained in:
committed by
intellij-monorepo-bot
parent
17718de545
commit
7ce7e4b99e
@@ -78,7 +78,11 @@ class IdeScaleTransformer : PersistentStateComponent<IdeScaleTransformer.Persist
|
||||
performTweaking(newParameters)
|
||||
}
|
||||
|
||||
private fun scale(newScaleFactor: Float, performBeforeTweaking: (() -> Unit)? = null) {
|
||||
fun scale(newScaleFactor: Float) {
|
||||
scale(newScaleFactor, null)
|
||||
}
|
||||
|
||||
private fun scale(newScaleFactor: Float, performBeforeTweaking: (() -> Unit)?) {
|
||||
prepareTweaking()
|
||||
performBeforeTweaking?.invoke()
|
||||
val newParameters = ScalingParameters.ScaleOriented(newScaleFactor, savedOriginalConsoleFontSize)
|
||||
|
||||
@@ -648,8 +648,11 @@ class LafManagerImpl : LafManager(), PersistentStateComponent<Element>, Disposab
|
||||
}
|
||||
|
||||
override fun applyDensity() {
|
||||
val ideScale = IdeScaleTransformer.instance.currentScale
|
||||
IdeScaleTransformer.instance.reset() // need to temporarily reset this to correctly apply new size values
|
||||
setCurrentLookAndFeel(currentLookAndFeel!!)
|
||||
updateUI()
|
||||
IdeScaleTransformer.instance.scale(ideScale)
|
||||
}
|
||||
|
||||
private fun applyDensity(defaults: UIDefaults) {
|
||||
|
||||
Reference in New Issue
Block a user