Add margin to box headings
This commit is contained in:
@@ -57,8 +57,9 @@ pub fn box_with_heading(
|
||||
height: Int,
|
||||
heading: String,
|
||||
) -> Buffer {
|
||||
let heading_margin = 1
|
||||
box(buffer, x, y, width, height)
|
||||
|> text(heading, x, y)
|
||||
|> text(heading, x + heading_margin, y)
|
||||
}
|
||||
|
||||
fn horizontal_line(
|
||||
|
||||
@@ -58,8 +58,8 @@ pub fn percent_layout_test() {
|
||||
let expected =
|
||||
"
|
||||
┌──────────────────────────────────────────────────────────────────────────────┐
|
||||
│row 1────────────────────────────────────────────────────────────────────────┐│
|
||||
││cell 1───────────────────────────────┐cell 2───────────────────────────────┐││
|
||||
│┌row 1───────────────────────────────────────────────────────────────────────┐│
|
||||
││┌cell 1──────────────────────────────┐┌cell 2──────────────────────────────┐││
|
||||
│││ ││ │││
|
||||
│││ ││ │││
|
||||
│││ ││ │││
|
||||
@@ -67,7 +67,7 @@ pub fn percent_layout_test() {
|
||||
│││ ││ │││
|
||||
││└────────────────────────────────────┘└────────────────────────────────────┘││
|
||||
│└────────────────────────────────────────────────────────────────────────────┘│
|
||||
│row 1────────────────────────────────────────────────────────────────────────┐│
|
||||
│┌row 1───────────────────────────────────────────────────────────────────────┐│
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
|
||||
Reference in New Issue
Block a user