From 74db852c6d62713b4bb9ca6055bb4cae7065fad3 Mon Sep 17 00:00:00 2001 From: neil Date: Mon, 8 Aug 2016 19:13:13 +0000 Subject: [PATCH] Fixed MUIA_List_AdjustWidth and MUIA_List_AdjustHeight. As well as the dimensions not being fixed, horizontal column spacing and the widths of vertical bars were not considered when calculating column widths. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@52844 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/libs/muimaster/classes/list.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/workbench/libs/muimaster/classes/list.c b/workbench/libs/muimaster/classes/list.c index 6bcd289031..a5d0d97589 100644 --- a/workbench/libs/muimaster/classes/list.c +++ b/workbench/libs/muimaster/classes/list.c @@ -719,7 +719,8 @@ static void CalcWidths(struct IClass *cl, Object *obj) } for (j = 0; j < data->columns; j++) - data->entries_maxwidth += data->ci[j].entries_width; + data->entries_maxwidth += data->ci[j].entries_width + + data->ci[j].delta + (data->ci[j].bar ? BAR_WIDTH : 0); if (!data->entry_maxheight) data->entry_maxheight = 1; @@ -1593,8 +1594,8 @@ IPTR List__MUIM_AskMinMax(struct IClass *cl, Object *obj, if ((data->flags & LIST_ADJUSTWIDTH) && (data->entries_num > 0)) { msg->MinMaxInfo->MinWidth += data->entries_maxwidth; - msg->MinMaxInfo->DefWidth += data->entries_maxwidth; - msg->MinMaxInfo->MaxWidth += data->entries_maxwidth; + msg->MinMaxInfo->DefWidth = msg->MinMaxInfo->MinWidth; + msg->MinMaxInfo->MaxWidth = msg->MinMaxInfo->MinWidth; } else { @@ -1608,8 +1609,8 @@ IPTR List__MUIM_AskMinMax(struct IClass *cl, Object *obj, if (data->flags & LIST_ADJUSTHEIGHT) { msg->MinMaxInfo->MinHeight += data->entries_totalheight; - msg->MinMaxInfo->DefHeight += data->entries_totalheight; - msg->MinMaxInfo->MaxHeight += data->entries_totalheight; + msg->MinMaxInfo->DefHeight = msg->MinMaxInfo->MinHeight; + msg->MinMaxInfo->MaxHeight = msg->MinMaxInfo->MinHeight; } else { @@ -1625,8 +1626,9 @@ IPTR List__MUIM_AskMinMax(struct IClass *cl, Object *obj, msg->MinMaxInfo->DefHeight += 96; msg->MinMaxInfo->MaxHeight = MUI_MAXMAX; } - D(bug("List %p minheigh=%d, line maxh=%d\n", + D(bug("List %p minheight=%d, line maxh=%d\n", obj, msg->MinMaxInfo->MinHeight, data->entry_maxheight)); + return TRUE; } -- 2.11.4.GIT