Move styling to style and add Border type

This commit is contained in:
Alexander Heldt
2025-12-26 12:13:11 +01:00
parent 4329625cf4
commit 68bf808635
5 changed files with 93 additions and 40 deletions

View File

@@ -5,8 +5,9 @@ import gleam/string
import gleeunit
import gleeunit/should
import musicplayer/ui/layout.{Percent, RenderContext, Section, Style}
import musicplayer/ui/layout.{RenderContext, Section}
import musicplayer/ui/plot
import musicplayer/ui/style.{Percent, Style}
pub fn main() -> Nil {
gleeunit.main()
@@ -19,7 +20,10 @@ pub fn percent_layout_test() {
Section("Row1"),
layout.Row(
heading: Some("row 1"),
style: Style(dimensions: Percent(width: 100, height: 50)),
style: Style(
dimensions: Percent(width: 100, height: 50),
border: Some(style.BorderSingle),
),
children: [
Section("A"),
Section("B"),
@@ -30,21 +34,30 @@ pub fn percent_layout_test() {
Section("A"),
layout.Cell(
heading: Some("cell 1"),
style: Style(dimensions: Percent(width: 50, height: 100)),
style: Style(
dimensions: Percent(width: 50, height: 100),
border: Some(style.BorderSingle),
),
),
),
#(
Section("B"),
layout.Cell(
heading: Some("cell 2"),
style: Style(dimensions: Percent(width: 50, height: 100)),
style: Style(
dimensions: Percent(width: 50, height: 100),
border: Some(style.BorderSingle),
),
),
),
#(
Section("Row2"),
layout.Row(
heading: Some("row 1"),
style: Style(dimensions: Percent(width: 100, height: 50)),
style: Style(
dimensions: Percent(width: 100, height: 50),
border: Some(style.BorderSingle),
),
children: [],
),
),