]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/layout.cxx
Boris Koenig:
[flightgear.git] / src / GUI / layout.cxx
index 40f16a326e7a42d51da518dfde305e1ae54d5ea6..d465c79203a2a4ceef913fc1e34f2e74c98143df 100644 (file)
@@ -24,7 +24,10 @@ bool LayoutWidget::eq(const char* a, const char* b)
 int LayoutWidget::padding()
 {
     int pad = isType("group") ? 0 : 4;
-    if(isType("dialog")) pad = 2;
+    // As comments above note,  this was being set to 2.  For some
+    // reason this causes the dialogs to shrink on subsequent pops
+    // so for now we'll make "dialog" padding 0.
+    if(isType("dialog")) pad = 0;
     if(hasParent() && parent().hasField("default-padding"))
         pad = parent().getNum("default-padding");
     if(hasField("padding"))
@@ -63,8 +66,9 @@ void LayoutWidget::calcPrefSize(int* w, int* h)
         *w = 17*UNIT;
         *h = 6*UNIT;
     } else if (isType("slider")) {
-        if(getBool("vertical")) *w = 3*UNIT;
-        else                    *h = 3*UNIT;
+        *w = *h = 17*UNIT;
+        if(getBool("vertical")) *w = 4*UNIT;
+        else                    *h = 4*UNIT;
     } else if (isType("list") || isType("airport-list") || isType("dial")) {
         *w = *h = 12*UNIT;
     }
@@ -152,8 +156,8 @@ void LayoutWidget::layout(int x, int y, int w, int h)
         w = h = 3*UNIT;
     } else if (isType("slider")) {
         // Fix the thickness to a constant
-        if(getBool("vertical")) { x += (w-3*UNIT)/2; w = 3*UNIT; }
-        else                    { y += (h-3*UNIT)/2; h = 3*UNIT; }
+        if(getBool("vertical")) { x += (w-4*UNIT)/2; w = 4*UNIT; }
+        else                    { y += (h-4*UNIT)/2; h = 4*UNIT; }
     }
 
     // Set out output geometry