Skip to content

Commit fbe9e9d

Browse files
committed
Remove large blank space in-between 'Settings' and 'Validate' button
1 parent e300fbd commit fbe9e9d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

csv-validator-ui/src/main/scala/uk/gov/nationalarchives/csv/validator/ui/CsvValidatorUi.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ object CsvValidatorUi extends SimpleSwingApplication {
7171
//handle resizing the main window, when resizing the settings panel
7272
settings.settingsGroup.reactions += SJXTaskPane.onViewStateChanged {
7373
this.preferredSize = this.size
74+
if (settings.settingsGroup.collapsed) settings.settingsGroup.remove(settings.settingsGroupLayout)
75+
else settings.settingsGroup.add(settings.settingsGroupLayout)
76+
7477
this.pack()
7578
}
7679
new ContentPanel(settings, this)
@@ -582,7 +585,7 @@ object CsvValidatorUi extends SimpleSwingApplication {
582585
btnRemovePathSubstitution.reactions += onClick(tblPathSubstitutions.removeSelectedRows())
583586
btnAddPathSubstitution.reactions += onClick(tablePathDialog())
584587

585-
private val settingsGroupLayout = new GridBagPanel {
588+
val settingsGroupLayout: GridBagPanel = new GridBagPanel {
586589
private val c = new Constraints
587590
c.anchor = Anchor.West
588591

@@ -658,7 +661,6 @@ object CsvValidatorUi extends SimpleSwingApplication {
658661
c.anchor = Anchor.LastLineEnd
659662
layout(btnAddPathSubstitution) = c
660663
}
661-
settingsGroup.add(settingsGroupLayout)
662664

663665
add(settingsGroup)
664666

csv-validator-ui/src/main/scala/uk/gov/nationalarchives/csv/validator/ui/SJXHelpers.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class SJXTaskPane(title: String) extends Panel with Publisher {
4444
this.collapsed = collapsed
4545
}
4646
def add(component: Component) = peer.add(component.peer)
47+
def remove(component: Component) = peer.remove(component.peer)
4748
def collapsed = peer.isCollapsed
4849
def collapsed_= (c : Boolean) : Unit = {
4950
peer.setCollapsed(c)

0 commit comments

Comments
 (0)