diff --git a/src/box-layout-node.c b/src/box-layout-node.c index 6355042..7b6dbc9 100644 --- a/src/box-layout-node.c +++ b/src/box-layout-node.c @@ -143,6 +143,14 @@ int box_layout_handle(UINode *component, enum UIEvent ev, size_t d, void *p) return 0; } +void box_layout_set_margins(UIBoxLayoutNode *layout, double margin) +{ + layout->margin_top = margin; + layout->margin_left = margin; + layout->margin_bottom = margin; + layout->margin_right = margin; +} + UIBoxLayoutNode *box_layout_new(UINode *parent, enum UIDirection direction) { UIBoxLayoutNode *n = malloc(sizeof(UIBoxLayoutNode)); diff --git a/src/box-layout-node.h b/src/box-layout-node.h index be7327f..078f409 100644 --- a/src/box-layout-node.h +++ b/src/box-layout-node.h @@ -10,6 +10,7 @@ typedef struct UIBoxLayoutNode { } UIBoxLayoutNode; UIBoxLayoutNode *box_layout_new(UINode *parent, enum UIDirection direction); +void box_layout_set_margins(UIBoxLayoutNode *layout, double margin); int box_layout_handle(UINode *component, enum UIEvent ev, size_t d, void *p); #endif // _UI__BOX_LAYOUT_NODE_H