Revert "Kotlin UI DSL: add new flag to suppress visual padding"

This reverts commit 62dd0ead

GitOrigin-RevId: 8fc9d282bf3a42c59d0f3bc9ec8780ca7b85fad6
This commit is contained in:
Vassiliy.Kudryashov
2021-03-19 07:36:39 +00:00
committed by intellij-monorepo-bot
parent afc371e029
commit e1e5c0637f
3 changed files with 9 additions and 16 deletions
@@ -26,12 +26,6 @@ enum class LCFlags {
*/
fill, fillX, fillY,
/**
* This option allows to toggle default state (true) for layout constraints that we use to better alignment on macOS
* where (text fields, checkboxes, buttons and so on) have focus ring that drawn outside of component border.
* In case ones mixes several panels with complex layout inside visual padding may cause truncated focus rings.
*/
noVisualPadding,
debug
}
@@ -115,6 +115,13 @@ internal class MigLayoutBuilder(val spacing: SpacingConfiguration) : LayoutBuild
override fun build(container: Container, layoutConstraints: Array<out LCFlags>) {
val lc = createLayoutConstraints()
lc.gridGapY = gapToBoundSize(spacing.verticalGap, false)
if (layoutConstraints.isEmpty()) {
lc.fillX()
// not fillY because it leads to enormously large cells - we use cc `push` in addition to cc `grow` as a more robust and easy solution
}
else {
lc.apply(layoutConstraints)
}
/**
* On macOS input fields (text fields, checkboxes, buttons and so on) have focus ring that drawn outside of component border.
@@ -133,14 +140,6 @@ internal class MigLayoutBuilder(val spacing: SpacingConfiguration) : LayoutBuild
// if 3, invisible component will be disregarded completely and it means that if it is last component, it's "wrap" constraint will be not taken in account
lc.hideMode = 2
if (layoutConstraints.isEmpty()) {
lc.fillX()
// not fillY because it leads to enormously large cells - we use cc `push` in addition to cc `grow` as a more robust and easy solution
}
else {
lc.apply(layoutConstraints)
}
val rowConstraints = AC()
(container as JComponent).putClientProperty(IS_VISUAL_PADDING_COMPENSATED_ON_COMPONENT_LEVEL_KEY, false)
var isLayoutInsetsAdjusted = false
@@ -309,7 +308,7 @@ private fun LC.apply(flags: Array<out LCFlags>): LC {
LCFlags.fill -> fill()
LCFlags.fillX -> isFillX = true
LCFlags.fillY -> isFillY = true
LCFlags.noVisualPadding -> isVisualPadding = false
LCFlags.debug -> debug()
}
}
@@ -16,7 +16,7 @@ class GroovyHotSwapConfigurable(
helpTopic = "reference.idesettings.debugger.groovy"
) {
override fun createPanel(): DialogPanel = panel(LCFlags.noVisualPadding) {
override fun createPanel(): DialogPanel = panel {
row {
checkBox(CheckboxDescriptor(
name = GroovyBundle.message("configurable.hotswap.checkbox"),