Fix columns with fixed width

This commit is contained in:
raa 2017-03-28 00:07:31 +03:00
parent 6a5e92c022
commit 5ce120b865

@ -2266,6 +2266,7 @@ static void ui_litem_estimate_column(uiLayout *litem, bool is_box)
{
uiItem *item;
int itemw, itemh;
bool min_size_flag = true;
litem->w = 0;
litem->h = 0;
@ -2273,12 +2274,18 @@ static void ui_litem_estimate_column(uiLayout *litem, bool is_box)
for (item = litem->items.first; item; item = item->next) {
ui_item_size(item, &itemw, &itemh);
min_size_flag = min_size_flag && (item->flag & UI_ITEM_MIN);
litem->w = MAX2(litem->w, itemw);
litem->h += itemh;
if (item->next && (!is_box || item != litem->items.first))
litem->h += litem->space;
}
if (min_size_flag) {
litem->item.flag |= UI_ITEM_MIN;
}
}
static void ui_litem_layout_column(uiLayout *litem, bool is_box)
@ -2446,6 +2453,7 @@ static void ui_litem_estimate_box(uiLayout *litem)
uiStyle *style = litem->root->style;
ui_litem_estimate_column(litem, true);
litem->item.flag &= ~UI_ITEM_MIN;
litem->w += 2 * style->boxspace;
litem->h += 2 * style->boxspace;
}