Ver código fonte

Merge pull request #1477 from sgrenier/next

Minor UI changes
Steve Grenier 11 anos atrás
pai
commit
a61e83ac5b
2 arquivos alterados com 13 adições e 1 exclusões
  1. 12 0
      gameplay/src/Control.cpp
  2. 1 1
      gameplay/src/Form.cpp

+ 12 - 0
gameplay/src/Control.cpp

@@ -226,6 +226,18 @@ void Control::initialize(const char* typeName, Theme::Style* style, Properties*
         // Parse the auto-size mode for the control (this overrides explicit sizes and legacy autoWidth/autoHeight)
         // Parse the auto-size mode for the control (this overrides explicit sizes and legacy autoWidth/autoHeight)
         _autoSize = parseAutoSize(properties->getString("autoSize"));
         _autoSize = parseAutoSize(properties->getString("autoSize"));
 
 
+        // If there is are simple padding or margin variables, parse them
+        if (properties->exists("padding"))
+        {
+            float pad = properties->getFloat("padding");
+            setPadding(pad, pad, pad, pad);
+        }
+        if (properties->exists("margin"))
+        {
+            float margin = properties->getFloat("margin");
+            setPadding(margin, margin, margin, margin);
+        }
+
 		if (properties->exists("enabled"))
 		if (properties->exists("enabled"))
 		{
 		{
 			setEnabled(properties->getBool("enabled"));
 			setEnabled(properties->getBool("enabled"));

+ 1 - 1
gameplay/src/Form.cpp

@@ -969,7 +969,7 @@ void Form::resizeEventInternal(unsigned int width, unsigned int height)
         if (form)
         if (form)
         {
         {
             // Dirty the form
             // Dirty the form
-            form->setDirty(Control::DIRTY_STATE);
+            form->setDirty(Control::DIRTY_BOUNDS | Control::DIRTY_STATE);
         }
         }
     }
     }
 }
 }