diff --git a/platform/platform-impl/src/com/intellij/ui/dsl/builder/impl/PanelImpl.kt b/platform/platform-impl/src/com/intellij/ui/dsl/builder/impl/PanelImpl.kt index 7d6210a29801..2eea42b35b30 100644 --- a/platform/platform-impl/src/com/intellij/ui/dsl/builder/impl/PanelImpl.kt +++ b/platform/platform-impl/src/com/intellij/ui/dsl/builder/impl/PanelImpl.kt @@ -294,7 +294,7 @@ internal open class PanelImpl(private val dialogPanelConfig: DialogPanelConfig, val row = row { @Suppress("DialogTitleCapitalization") label(title) - .applyToComponent { putClientProperty(DslComponentPropertyInternal.LABEL_NO_BOTTOM_GAP, true) } + .applyToComponent { putClientProperty(DslComponentProperty.NO_BOTTOM_GAP, true) } } row.internalBottomGap = spacingConfiguration.buttonGroupHeaderBottomGap } diff --git a/platform/platform-impl/src/com/intellij/ui/dsl/builder/impl/utils.kt b/platform/platform-impl/src/com/intellij/ui/dsl/builder/impl/utils.kt index 04ee05b0f845..3d2d6ab1f657 100644 --- a/platform/platform-impl/src/com/intellij/ui/dsl/builder/impl/utils.kt +++ b/platform/platform-impl/src/com/intellij/ui/dsl/builder/impl/utils.kt @@ -30,11 +30,6 @@ import javax.swing.text.JTextComponent */ @ApiStatus.Internal internal enum class DslComponentPropertyInternal { - /** - * Removes standard bottom gap from label - */ - LABEL_NO_BOTTOM_GAP, - /** * A mark that component is a cell label, see [Cell.label] * @@ -117,7 +112,7 @@ internal fun prepareVisualPaddings(component: JComponent): Gaps { internal fun getComponentGaps(left: Int, right: Int, component: JComponent, spacing: SpacingConfiguration): Gaps { val top = getDefaultVerticalGap(component, spacing) var bottom = top - if (component is JLabel && component.getClientProperty(DslComponentPropertyInternal.LABEL_NO_BOTTOM_GAP) == true) { + if (component.getClientProperty(DslComponentProperty.NO_BOTTOM_GAP) == true) { bottom = 0 } return Gaps(top = top, left = left, bottom = bottom, right = right) diff --git a/platform/platform-impl/src/com/intellij/ui/dsl/builder/utils.kt b/platform/platform-impl/src/com/intellij/ui/dsl/builder/utils.kt index 491469b7cd06..cc2d93605300 100644 --- a/platform/platform-impl/src/com/intellij/ui/dsl/builder/utils.kt +++ b/platform/platform-impl/src/com/intellij/ui/dsl/builder/utils.kt @@ -22,7 +22,17 @@ enum class DslComponentProperty { * * Value: [Gaps] */ - VISUAL_PADDINGS + VISUAL_PADDINGS, + + /** + * By default, almost every control have [SpacingConfiguration.verticalComponentGap] above and below it. + * This flag disables such gap below the control. Should be used in very rare situations (e.g. row with label **and** some additional + * label-kind controls above related to the label control), because most standard cases are covered by Kotlin UI DSL API + * + * Value: [Boolean] + */ + NO_BOTTOM_GAP + } /**