]> git.mxchange.org Git - simgear.git/blobdiff - simgear/canvas/layout/Layout.cxx
canvas::Layout: support for contents margins.
[simgear.git] / simgear / canvas / layout / Layout.cxx
index d3ae38867007e97fb9dd23673b78eeaef1afb3a5..ee24be6e1853678768e5faf79e7766b2049307f5 100644 (file)
@@ -24,36 +24,6 @@ namespace simgear
 namespace canvas
 {
 
-  //----------------------------------------------------------------------------
-  void Layout::update()
-  {
-    if( !(_flags & (LAYOUT_DIRTY | SIZE_INFO_DIRTY)) || !isVisible() )
-      return;
-
-    doLayout(_geometry);
-
-    _flags &= ~LAYOUT_DIRTY;
-  }
-
-  //----------------------------------------------------------------------------
-  void Layout::invalidate()
-  {
-    LayoutItem::invalidate();
-    _flags |= LAYOUT_DIRTY;
-  }
-
-  //----------------------------------------------------------------------------
-  void Layout::setGeometry(const SGRecti& geom)
-  {
-    if( geom != _geometry )
-    {
-      _geometry = geom;
-      _flags |= LAYOUT_DIRTY;
-    }
-
-    update();
-  }
-
   //----------------------------------------------------------------------------
   void Layout::removeItem(const LayoutItemRef& item)
   {
@@ -108,6 +78,14 @@ namespace canvas
       return layout_item->minimumSize().y();
   }
 
+  //----------------------------------------------------------------------------
+  void Layout::contentsRectChanged(const SGRecti& rect)
+  {
+    doLayout(rect);
+
+    _flags &= ~LAYOUT_DIRTY;
+  }
+
   //----------------------------------------------------------------------------
   void Layout::distribute(std::vector<ItemData>& items, const ItemData& space)
   {