Skip to content

Commit

Permalink
refactor(cli): Avoid the need to determine the ORT logo with
Browse files Browse the repository at this point in the history
Use a new more flexible column width option, see [1].

[1]: ajalt/mordant#109 (comment)

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Oct 4, 2023
1 parent 2857051 commit a7ae4b7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cli/src/main/kotlin/OrtMain.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private val ORT_LOGO = """
\________/ |____|___/ |____|
""".trimIndent()

private val ORT_LOGO_WIDTH = ORT_LOGO.lines().maxOf { it.length }
private const val HIGHEST_WIDTH_PRIORITY = 100

class OrtMain : CliktCommand(
name = ORT_NAME,
Expand Down Expand Up @@ -171,7 +171,10 @@ class OrtMain : CliktCommand(

private fun getOrtHeader(version: String): Widget =
grid {
column(0) { width = ColumnWidth.Fixed(ORT_LOGO_WIDTH) }
column(0) {
width = ColumnWidth.Custom(width = null, expandWeight = null, priority = HIGHEST_WIDTH_PRIORITY)
}

column(1) { verticalAlign = VerticalAlign.BOTTOM }
padding { bottom = 1 }

Expand Down

0 comments on commit a7ae4b7

Please sign in to comment.