diff --git a/platform/platform-impl/src/com/intellij/ui/layout/migLayout/MigLayoutBuilder.kt b/platform/platform-impl/src/com/intellij/ui/layout/migLayout/MigLayoutBuilder.kt index c0913a9aae02..4ae179d83c84 100644 --- a/platform/platform-impl/src/com/intellij/ui/layout/migLayout/MigLayoutBuilder.kt +++ b/platform/platform-impl/src/com/intellij/ui/layout/migLayout/MigLayoutBuilder.kt @@ -53,6 +53,9 @@ internal class MigLayoutBuilder : LayoutBuilderImpl { } override fun noteRow(text: String) { + // add empty row as top gap +// newRow() + val cc = CC() cc.vertical.gapBefore = gapToBoundSize(VERTICAL_GAP, false) cc.vertical.gapAfter = gapToBoundSize(VERTICAL_GAP * 2, false) diff --git a/platform/platform-tests/testData/ui/layout/note row in the dialog.yml b/platform/platform-tests/testData/ui/layout/note row in the dialog.yml index a8197cee79a9..7ab889724019 100644 --- a/platform/platform-tests/testData/ui/layout/note row in the dialog.yml +++ b/platform/platform-tests/testData/ui/layout/note row in the dialog.yml @@ -5,7 +5,7 @@ columnConstraints: - {} - {grow: 100.0} componentConstrains: - 'JLabel #0': + 'MultiLineLabel #0': spanX: 2097051.0 wrap: true vertical: @@ -24,3 +24,13 @@ componentConstrains: max: {value: 250.0, unitString: px} preferred: {value: 250.0, unitString: px} 'JCheckBox #3': {skip: 1.0, spanX: 2097051.0, wrap: true} + 'JLabel #4': + spanX: 2097051.0 + wrap: true + vertical: + gapBefore: + min: {value: 5.0, unitString: px} + preferred: {value: 5.0, unitString: px} + gapAfter: + min: {value: 10.0, unitString: px} + preferred: {value: 10.0, unitString: px} diff --git a/platform/platform-tests/testSrc/com/intellij/ui/layout/UiDslTest.kt b/platform/platform-tests/testSrc/com/intellij/ui/layout/UiDslTest.kt index 8ef983103ea7..247ce755cd66 100644 --- a/platform/platform-tests/testSrc/com/intellij/ui/layout/UiDslTest.kt +++ b/platform/platform-tests/testSrc/com/intellij/ui/layout/UiDslTest.kt @@ -106,10 +106,11 @@ class UiDslTest { fun `note row in the dialog`() { val passwordField = JPasswordField() doTest(panel { - noteRow("Profiler requires access to the kernel-level API. Enter the sudo password to allow this. ") + noteRow("Profiler requires access to the kernel-level API.\nEnter the sudo password to allow this. ") row("Sudo password:") { passwordField() } row { CheckBox(CommonBundle.message("checkbox.remember.password"), true)() } - }, "[0, 0, 544, 31], [0, 36, 99, 26], [119, 36, 425, 26], [119, 67, 425, 23]") + noteRow("Should be an empty row above as a gap") + }, "[0, 0, 512, 47], [0, 52, 99, 26], [119, 52, 393, 26], [119, 83, 393, 23], [0, 111, 512, 31]") } private fun doTest(panel: JPanel, expectedLocations: String) {