Fixed vertical gap in CMake configuration

GitOrigin-RevId: b24fb0014de94c690f7ee937aeaf3a1a2293afd8
This commit is contained in:
Pavel Porvatov
2022-07-05 20:05:52 +00:00
committed by intellij-monorepo-bot
parent d13bc988ba
commit 7eae8a8696
3 changed files with 13 additions and 8 deletions
@@ -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
}
@@ -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)
@@ -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
}
/**