Skip to content

Commit

Permalink
refactor: optimize spacing between UI elements
Browse files Browse the repository at this point in the history
  • Loading branch information
lppedd committed Feb 5, 2020
1 parent 1b13944 commit 556d9eb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ private void finishUpComponents(final Disposable disposable) {
);

final GridConstraints gc = new GridConstraints();
gc.setIndent(1);
gc.setFill(FILL_BOTH);
gc.setHSizePolicy(SIZEPOLICY_CAN_SHRINK | SIZEPOLICY_CAN_GROW | SIZEPOLICY_WANT_GROW);
defaultsPanel.add(new DefaultsFileExportHolder().getComponent(), gc);
Expand All @@ -129,6 +130,7 @@ private void finishUpComponents(final Disposable disposable) {
defaultsPanel.add(defaultsFilePickerHolder.getComponent(), gc);

gc.setRow(2);
gc.setIndent(0);
gc.setVSizePolicy(SIZEPOLICY_CAN_SHRINK | SIZEPOLICY_CAN_GROW | SIZEPOLICY_WANT_GROW);
defaultsPanel.add(defaultsListsHolder.getComponent(), gc);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import javax.swing.JPanel
internal class DefaultsFileExportHolder : ComponentHolder, LinkListener<Any?> {
private val exportAction = ActionLinkLabel(CCBundle["cc.config.defaults.exportToPath"], this)
private val exportInfo = JBLabel()
private val panel = JPanel(GridLayoutManager(1, 2, JBUI.insetsLeft(10), 20, 0)).apply {
private val panel = JPanel(GridLayoutManager(1, 2, JBUI.insets(0, 1, 6, 0), 20, 0)).apply {
val gc = GridConstraints()
gc.fill = GridConstraints.FILL_HORIZONTAL
gc.hSizePolicy = GridConstraints.SIZEPOLICY_FIXED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import javax.swing.event.DocumentEvent
* @author Edoardo Luppi
*/
internal class DefaultsFilePickerHolder(private val disposable: Disposable) : ComponentHolder {
private val panel = JPanel(GridLayoutManager(2, 1, JBUI.insetsLeft(10), 0, 10))
private val panel = JPanel(GridLayoutManager(2, 1, JBUI.emptyInsets(), 0, 10))
private val isCustomFile = JBCheckBox(CCBundle["cc.config.defaults.customDefaults"])
private val customFile = TextFieldWithBrowseButton()
private var isValid = true
Expand Down

0 comments on commit 556d9eb

Please sign in to comment.