]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/layout.cxx
don't initialize iterator twice
[flightgear.git] / src / GUI / layout.cxx
index 0f2b81059f204b13fd2fb7cd5d381d76da1d91ff..12d13df7d476046695a9e6d8ce1dbd9fdcc8db30 100644 (file)
@@ -39,7 +39,7 @@ void LayoutWidget::calcPrefSize(int* w, int* h)
 {
     *w = *h = 0; // Ask for nothing by default
 
-    if (getBool("hide"))
+    if (getBool("hide") || isType("nasal"))
         return;
 
     int legw = stringLength(getStr("legend"));
@@ -97,7 +97,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("hide") || isType("nasal"))
         return;
 
     setNum("__bx", x);
@@ -185,10 +185,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
@@ -318,7 +315,7 @@ void LayoutWidget::doTable(bool doLayout, int* w, int* h)
             int total = 0;
             for(j=0; j<cell->rspan; j++)
                 total += rowSizes[cell->row + j];
-            int extra = total - cell->h;
+            int extra = cell->h - total;
             if(extra > 0) {
                 for(j=0; j<cell->rspan; j++) {
                     int chunk = extra / (cell->rspan - j);
@@ -331,7 +328,7 @@ void LayoutWidget::doTable(bool doLayout, int* w, int* h)
             int total = 0;
             for(j=0; j<cell->cspan; j++)
                 total += colSizes[cell->col + j];
-            int extra = total - cell->w;
+            int extra = cell->w - total;
             if(extra > 0) {
                 for(j=0; j<cell->cspan; j++) {
                     int chunk = extra / (cell->cspan - j);