diff --git a/test/spaced.c b/test/spaced.c index 6d080b0e..f2e26631 100644 --- a/test/spaced.c +++ b/test/spaced.c @@ -36,6 +36,7 @@ void setSpaced(int spaced) { uintmax_t i; void *p; + uintmax_t j, n; for (i = 0; i < len; i++) { p = things[i].ptr; @@ -47,7 +48,9 @@ void setSpaced(int spaced) uiBoxSetPadded(uiBox(p), spaced); break; case tab: - // TODO + n = uiTabNumPages(uiTab(p)); + for (j = 0; j < n; j++) + uiTabSetMargined(uiTab(p), j, spaced); break; } } @@ -59,26 +62,29 @@ void querySpaced(char out[12]) // more than enough int p = 0; uintmax_t i; void *pp; + uintmax_t j, n; for (i = 0; i < len; i++) { pp = things[i].ptr; switch (things[i].type) { case window: - m = uiWindowMargined(uiWindow(pp)); + if (uiWindowMargined(uiWindow(pp))) + m++; break; case box: p = uiBoxPadded(uiBox(pp)); break; + case tab: + n = uiTabNumPages(uiTab(pp)); + for (j = 0; j < n; j++) + if (uiTabMargined(uiTab(pp), j)) + m++; } - if (m && p) // cheap attempt at breaking early - break; } out[0] = 'm'; out[1] = ' '; - out[2] = '0'; - if (m) - out[2] = '1'; + out[2] = '0' + m; out[3] = ' '; out[4] = 'p'; out[5] = ' '; diff --git a/ui.idl b/ui.idl index 05e1e56a..110aaa35 100644 --- a/ui.idl +++ b/ui.idl @@ -111,6 +111,9 @@ interface Tab from Control { // TODO remove Page from these? func AppendPage(name *const char, c *Control); func DeletePage(index uintmax_t); + func NumPages(void) uintmax_t; + func Margined(page uintmax_t) int; + func SetMargined(page uintmax_t, margined int); }; func NewTab(void) *Tab;