Skip to content

Commit 77e2ae0

Browse files
authored
Merge pull request #554 from digital-preservation/makeOutputBoxMoreResponsive
Make Output box more responsive
2 parents d19d365 + 4cd4462 commit 77e2ae0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ object CsvValidatorUi extends SimpleSwingApplication {
6464

6565
private def changeHeightOfOutputPane(heightDiff: Int): Unit = {
6666
// need to normalise the height change by converting it to "rows"
67-
val heightChangeAsRows = Math.ceil(heightDiff / 50f).toInt // 30 is just an arbitrary number that seemed to work fine
68-
val newHeight = if((txtArReport.rows + heightChangeAsRows) <= 1) txtArReport.rows + 1
69-
else if((txtArReport.rows + heightChangeAsRows) > 40) 40
67+
val heightChangeAsRows = Math.ceil(heightDiff / 30f).toInt // 30 is just an arbitrary number that seemed to work fine
68+
val newHeight = if(txtArReport.rows + heightChangeAsRows <= 1) 1
69+
else if(txtArReport.rows + heightChangeAsRows > 40) 40
7070
else txtArReport.rows + heightChangeAsRows
7171

7272
// sometimes the size and preferredSize height stay the same even when the window gets larger so just make box size large in this case
7373
val finalHeight = if(heightDiff == 0 && !prefSizeHeightChanged) 40 else newHeight
74-
txtArReport.rows = Math.abs(finalHeight)
74+
txtArReport.rows = finalHeight
7575
}
7676

7777
def top: SJXFrame = new SJXFrame {

0 commit comments

Comments
 (0)