Skip to content

Commit

Permalink
Merge pull request #554 from digital-preservation/makeOutputBoxMoreRe…
Browse files Browse the repository at this point in the history
…sponsive

Make Output box more responsive
  • Loading branch information
techncl authored Feb 25, 2025
2 parents d19d365 + 4cd4462 commit 77e2ae0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ object CsvValidatorUi extends SimpleSwingApplication {

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

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

def top: SJXFrame = new SJXFrame {
Expand Down

0 comments on commit 77e2ae0

Please sign in to comment.