From 2fd2a7171091f3c4de9e47f7eb1164c408510c13 Mon Sep 17 00:00:00 2001 From: nokoe Date: Mon, 18 Nov 2024 18:12:59 +0100 Subject: add table to document --- client/menu/document/document.gd | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'client/menu') diff --git a/client/menu/document/document.gd b/client/menu/document/document.gd index 69a0b852..ba7883dd 100644 --- a/client/menu/document/document.gd +++ b/client/menu/document/document.gd @@ -52,7 +52,18 @@ func build_document(element: Dictionary) -> Control: for e in element["es"]: node.add_child(text_node(e, true)) "table": - push_warning("Table not yet implemented") + node = VBoxContainer.new() + node.name = "Rows" + node.size_flags_horizontal = Control.SIZE_EXPAND_FILL + for r in range(element["es"].size()): + var row = HBoxContainer.new() + node.add_child(row) + row.size_flags_horizontal = Control.SIZE_EXPAND_FILL + row.name = "Row%d" % r + for c in element["es"][r]: + var e = build_document(c) + e.size_flags_horizontal = Control.SIZE_EXPAND_FILL + row.add_child(e) "par": node = VBoxContainer.new() node.name = "Paragraph" -- cgit v1.2.3-70-g09d2