wip-working

This commit is contained in:
Alexander Heldt
2025-11-30 13:29:52 +01:00
parent 2332710235
commit 50c053a42a
2 changed files with 186 additions and 24 deletions

View File

@@ -0,0 +1,87 @@
// import gleam/dict
// import gleam/int
// import gleeunit
// import musicplayer/ui/layout.{type Node, Layout, Section}
// pub fn main() -> Nil {
// gleeunit.main()
// }
// pub fn foo_test() {
// let expected = ""
// let layout =
// Layout(
// width: 80,
// height: 20,
// nodes:,
// dict.from_list([
// #(
// Section("Root"),
// Node(
// t: Container,
// content: "container",
// width_percent: 100,
// height_percent: 100,
// children: [
// Section("Row1"),
// Section("Row2"),
// ],
// ),
// ),
// #(
// Section("Row1"),
// Node(
// t: Row,
// content: "row 1",
// width_percent: 100,
// height_percent: 50,
// children: [
// Section("A"),
// Section("B"),
// ],
// ),
// ),
// #(
// Section("A"),
// Node(
// t: Cell,
// content: "cell 1",
// width_percent: 50,
// height_percent: 100,
// children: [],
// ),
// ),
// #(
// B,
// Node(
// t: Cell,
// content: "cell 2",
// width_percent: 50,
// height_percent: 100,
// children: [],
// ),
// ),
// #(
// Section("Row2"),
// Node(
// t: Row,
// content: "row 1",
// width_percent: 100,
// height_percent: 50,
// children: [],
// ),
// ),
// ]),
// )
// let container_width = int.to_float(layout.width)
// let container_height = int.to_float(layout.height)
// let container_top_left_x = 1
// let container_top_left_y = 1
// let assert Ok(data) =
// layout.render_loop(layout, container_width, container_height)
// assert data == 123.456789
// }