version 1.43, 2019/04/23 09:15:24 |
version 1.44, 2019/06/26 13:03:47 |
|
|
* case for the most upper panes only. |
* case for the most upper panes only. |
*/ |
*/ |
static int |
static int |
layout_need_status(struct layout_cell *lc, int at_top) |
layout_need_status(struct layout_cell *lc, int status) |
{ |
{ |
struct layout_cell *first_lc; |
struct layout_cell *next; |
|
|
if (lc->parent != NULL) { |
if (lc->parent != NULL) { |
if (lc->parent->type == LAYOUT_LEFTRIGHT) |
if (lc->parent->type == LAYOUT_LEFTRIGHT) |
return (layout_need_status(lc->parent, at_top)); |
return (layout_need_status(lc->parent, status)); |
|
|
if (at_top) |
if (status == PANE_STATUS_TOP) |
first_lc = TAILQ_FIRST(&lc->parent->cells); |
next = TAILQ_FIRST(&lc->parent->cells); |
else |
else |
first_lc = TAILQ_LAST(&lc->parent->cells,layout_cells); |
next = TAILQ_LAST(&lc->parent->cells,layout_cells); |
if (lc == first_lc) |
if (lc == next) |
return (layout_need_status(lc->parent, at_top)); |
return (layout_need_status(lc->parent, status)); |
return (0); |
return (0); |
} |
} |
return (1); |
return (1); |
|
|
if ((lc = wp->layout_cell) == NULL) |
if ((lc = wp->layout_cell) == NULL) |
continue; |
continue; |
|
|
if (status != 0) |
if (status != PANE_STATUS_OFF) |
shift = layout_need_status(lc, status == 1); |
shift = layout_need_status(lc, status); |
else |
else |
shift = 0; |
shift = 0; |
|
|
|
|
available = lc->sx; |
available = lc->sx; |
else { |
else { |
available = lc->sy; |
available = lc->sy; |
if (status != 0) |
if (status != PANE_STATUS_OFF) |
minimum += layout_need_status(lc, status == 1); |
minimum += layout_need_status(lc, status); |
} |
} |
if (available > minimum) |
if (available > minimum) |
available -= minimum; |
available -= minimum; |
|
|
break; |
break; |
case LAYOUT_TOPBOTTOM: |
case LAYOUT_TOPBOTTOM: |
minimum = PANE_MINIMUM * 2 + 1; |
minimum = PANE_MINIMUM * 2 + 1; |
if (status != 0) |
if (status != PANE_STATUS_OFF) |
minimum += layout_need_status(lc, status == 1); |
minimum += layout_need_status(lc, status); |
if (sy < minimum) |
if (sy < minimum) |
return (NULL); |
return (NULL); |
break; |
break; |
|
|
size = parent->sx; |
size = parent->sx; |
else if (parent->type == LAYOUT_TOPBOTTOM) { |
else if (parent->type == LAYOUT_TOPBOTTOM) { |
size = parent->sy; |
size = parent->sy; |
if (status != 0) |
if (status != PANE_STATUS_OFF) |
size -= layout_need_status(parent, status == 1); |
size -= layout_need_status(parent, status); |
} else |
} else |
return (0); |
return (0); |
if (size < number - 1) |
if (size < number - 1) |
|
|
layout_resize_adjust(w, lc, LAYOUT_LEFTRIGHT, change); |
layout_resize_adjust(w, lc, LAYOUT_LEFTRIGHT, change); |
} else if (parent->type == LAYOUT_TOPBOTTOM) { |
} else if (parent->type == LAYOUT_TOPBOTTOM) { |
this = each; |
this = each; |
if (status != 0) |
if (status != PANE_STATUS_OFF) |
this += layout_need_status(lc, status == 1); |
this += layout_need_status(lc, status); |
change = this - (int)lc->sy; |
change = this - (int)lc->sy; |
layout_resize_adjust(w, lc, LAYOUT_TOPBOTTOM, change); |
layout_resize_adjust(w, lc, LAYOUT_TOPBOTTOM, change); |
} |
} |