51 if (!(*wp)->state.visible)
58 const int avail =
MIN(space, (*wp)->req_cols);
59 (*wp)->state.cols = avail;
66 (*wp)->state.cols = 1;
79 space -= (*wp)->state.cols;
86 if ((max_count > 0) && (space > 0))
88 int alloc = (space + max_count - 1) / max_count;
93 if (!(*wp)->state.visible)
98 alloc =
MIN(space, alloc);
99 (*wp)->state.cols += alloc;
108 if (!(*wp)->state.visible)
111 (*wp)->state.col_offset = col;
113 col += (*wp)->state.cols;
140 if (!(*wp)->state.visible)
147 const int avail =
MIN(space, (*wp)->req_rows);
148 (*wp)->state.rows = avail;
155 (*wp)->state.rows = 1;
168 space -= (*wp)->state.rows;
175 if ((max_count > 0) && (space > 0))
177 int alloc = (space + max_count - 1) / max_count;
182 if (!(*wp)->state.visible)
187 alloc =
MIN(space, alloc);
188 (*wp)->state.rows += alloc;
197 if (!(*wp)->state.visible)
200 (*wp)->state.row_offset = row;
202 row += (*wp)->state.rows;
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define MIN(a, b)
Return the minimum of two values.
Convenience wrapper for the library headers.
@ MUTT_WIN_ORIENT_VERTICAL
Window uses all available vertical space.
@ MUTT_WIN_SIZE_FIXED
Window has a fixed size.
@ MUTT_WIN_SIZE_MINIMISE
Window size depends on its children.
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
static void window_reflow_vert(struct MuttWindow *win)
Reflow Windows using all the available vertical space.
static void window_reflow_horiz(struct MuttWindow *win)
Reflow Windows using all the available horizontal space.
void window_reflow(struct MuttWindow *win)
Reflow Windows.
struct MuttWindowArray children
Children Windows.
struct WindowState state
Current state of the Window.
enum MuttWindowOrientation orient
Which direction the Window will expand.
enum MuttWindowSize size
Type of Window, e.g. MUTT_WIN_SIZE_FIXED.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
short row_offset
Absolute on-screen row.
short col_offset
Absolute on-screen column.
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.