* Some code optimizations to panel collapse code, to avoid calculations for each panel. Suggested by "Bao 2".

This commit is contained in:
Thomas Dinges 2012-05-28 14:57:38 +00:00
parent 3091c9d440
commit d02b6707f9

@ -166,13 +166,13 @@ static int panels_re_align(ScrArea *sa, ARegion *ar, Panel **r_pa)
static void panels_collapse_all(ScrArea *sa, ARegion *ar)
{
Panel *pa;
int align = panel_aligned(sa, ar);
Panel *pa;
int flag = ((panel_aligned(sa, ar)==BUT_HORIZONTAL)? PNL_CLOSEDX: PNL_CLOSEDY);
for (pa= ar->panels.first; pa; pa= pa->next) {
if (pa->type && !(pa->type->flag & PNL_NO_HEADER))
pa->flag = (align==BUT_HORIZONTAL)? PNL_CLOSEDX: PNL_CLOSEDY;
}
for (pa= ar->panels.first; pa; pa= pa->next) {
if (pa->type && !(pa->type->flag & PNL_NO_HEADER))
pa->flag = flag;
}
}