X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FGUI%2Flayout.cxx;h=f9581b3d5503a957313a340b7ec867960bbbfe40;hb=02fb83c774020633cb62e3b8154337510bed1de3;hp=0f2b81059f204b13fd2fb7cd5d381d76da1d91ff;hpb=affa6b8a3822e5924a1ad3fe498867cca6b8b253;p=flightgear.git diff --git a/src/GUI/layout.cxx b/src/GUI/layout.cxx index 0f2b81059..f9581b3d5 100644 --- a/src/GUI/layout.cxx +++ b/src/GUI/layout.cxx @@ -1,5 +1,12 @@ + +#ifdef HAVE_CONFIG_H +# include +#endif + #include "layout.hxx" +#include + // This file contains the actual layout engine. It has no dependence // on outside libraries; see layout-props.cxx for the glue code. @@ -39,7 +46,7 @@ void LayoutWidget::calcPrefSize(int* w, int* h) { *w = *h = 0; // Ask for nothing by default - if (getBool("hide")) + if (!getBool("enabled", true) || isType("nasal")) return; int legw = stringLength(getStr("legend")); @@ -72,7 +79,8 @@ void LayoutWidget::calcPrefSize(int* w, int* h) *w = *h = 17*UNIT; if(getBool("vertical")) *w = 4*UNIT; else *h = 4*UNIT; - } else if (isType("list") || isType("airport-list") || isType("dial")) { + } else if (isType("list") || isType("airport-list") + || isType("property-list") || isType("dial")) { *w = *h = 12*UNIT; } else if (isType("hrule")) { *h = 1; @@ -97,7 +105,7 @@ void LayoutWidget::calcPrefSize(int* w, int* h) // Set up geometry such that the widget lives "inside" the specified void LayoutWidget::layout(int x, int y, int w, int h) { - if (getBool("hide")) + if (!getBool("enabled", true) || isType("nasal")) return; setNum("__bx", x); @@ -185,10 +193,7 @@ void LayoutWidget::layout(int x, int y, int w, int h) if (eq(layout, "hbox" )) doHVBox(true, false); else if(eq(layout, "vbox" )) doHVBox(true, true); else if(eq(layout, "table")) doTable(true); - } else if(isType("hrule")) - doHVBox(true, false); - else if(isType("vrule")) - doHVBox(true, true); + } } // Convention: the "A" cooridinate refers to the major axis of the @@ -201,7 +206,7 @@ void LayoutWidget::doHVBox(bool doLayout, bool vertical, int* w, int* h) int nEq = 0, eqA = 0, eqB = 0, eqTotalA = 0; for(i=0; irspan; j++) total += rowSizes[cell->row + j]; - int extra = total - cell->h; + int extra = cell->h - total; if(extra > 0) { for(j=0; jrspan; j++) { int chunk = extra / (cell->rspan - j); @@ -331,7 +336,7 @@ void LayoutWidget::doTable(bool doLayout, int* w, int* h) int total = 0; for(j=0; jcspan; j++) total += colSizes[cell->col + j]; - int extra = total - cell->w; + int extra = cell->w - total; if(extra > 0) { for(j=0; jcspan; j++) { int chunk = extra / (cell->cspan - j);