#include "container.h"
#include "object.h"
void ui_end_new(UiObject *obj) {
if(!obj->container_end) {
return;
}
UiContainerX *rm = obj->container_end;
uic_object_pop_container(obj);
ui_free(obj->ctx, rm);
}
void ui_newline(UiObject *obj) {
UiContainerX *container = obj->container_end;
if(container) {
container->newline =
TRUE;
}
}
void uic_layout_setup_expand_fill(
UiLayout *layout,
UiBool def_hexpand,
UiBool def_vexpand,
UiBool def_hfill,
UiBool def_vfill)
{
if(layout->fill) {
layout->hfill =
TRUE;
layout->vfill =
TRUE;
layout->hexpand =
TRUE;
layout->vexpand =
TRUE;
return;
}
if(!layout->override_defaults) {
if(def_hexpand) {
layout->hexpand =
TRUE;
}
if(def_hfill) {
layout->hfill =
TRUE;
}
if(def_vexpand) {
layout->vexpand =
TRUE;
}
if(def_vfill) {
layout->vfill =
TRUE;
}
}
}
void uic_layout_setup_margin(UiLayout *layout) {
int margin = layout->margin;
if(margin >
0) {
layout->margin_left = margin;
layout->margin_right = margin;
layout->margin_top = margin;
layout->margin_bottom = margin;
}
}