UI DSL: remove verticalPanel to simplify implementation and DSL

This commit is contained in:
Vladimir Krivosheev
2018-03-23 15:34:46 +01:00
parent 232b29888a
commit aea4f34683
2 changed files with 4 additions and 9 deletions
@@ -2,7 +2,6 @@
package com.intellij.ui.layout
import com.intellij.ui.components.Panel
import com.intellij.ui.layout.LCFlags.*
import javax.swing.JPanel
/**
@@ -23,8 +22,4 @@ inline fun panel(vararg constraints: LCFlags, title: String? = null, init: Layou
val panel = Panel(title, layout = null)
builder.builder.build(panel, constraints)
return panel
}
inline fun verticalPanel(init: Row.() -> Unit) = panel(noGrid, flowY, fillX) {
row(init = init)
}
@@ -49,9 +49,9 @@ internal class IcsConfigurableUi : ConfigurableUi<IcsSettings>, Disposable {
saveSettings(settings, icsManager.settingsFile)
}
override fun getComponent() = verticalPanel {
editors.get(0).component()
autoSync(comment = "Use VCS -> Sync Settings to sync when you want")
panel("Read-only Sources", editors.get(1).component)
override fun getComponent() = panel {
row { editors.get(0).component() }
row { autoSync(comment = "Use VCS -> Sync Settings to sync when you want") }
row { panel("Read-only Sources", editors.get(1).component) }
}
}