LayoutItems::iterator it = _layout_items.begin() + index;
LayoutItemRef item = it->layout_item;
- item->setParent(LayoutItemWeakRef());
item->onRemove();
+ item->setParent(LayoutItemWeakRef());
_layout_items.erase(it);
invalidate();
it != _layout_items.end();
++it )
{
- it->layout_item->setParent(LayoutItemWeakRef());
it->layout_item->onRemove();
+ it->layout_item->setParent(LayoutItemWeakRef());
}
_layout_items.clear();
invalidate();
return _layout_data.has_hfw;
}
- //----------------------------------------------------------------------------
- int BoxLayout::heightForWidth(int w) const
- {
- if( !hasHeightForWidth() )
- return -1;
-
- updateWFHCache(w);
- return _hfw_height;
- }
-
- //----------------------------------------------------------------------------
- int BoxLayout::minimumHeightForWidth(int w) const
- {
- if( !hasHeightForWidth() )
- return -1;
-
- updateWFHCache(w);
- return _hfw_min_height;
- }
-
//----------------------------------------------------------------------------
void BoxLayout::setCanvas(const CanvasWeakPtr& canvas)
{
}
// Add sizes of all children in layout direction
- safeAdd(min_size.x(), item_data.min_size);
- safeAdd(max_size.x(), item_data.max_size);
- safeAdd(size_hint.x(), item_data.size_hint);
+ SGMisc<int>::addClipOverflowInplace(min_size.x(), item_data.min_size);
+ SGMisc<int>::addClipOverflowInplace(max_size.x(), item_data.max_size);
+ SGMisc<int>::addClipOverflowInplace(size_hint.x(), item_data.size_hint);
// Take maximum in fixed (non-layouted) direction
min_size.y() = std::max( min_size.y(),
_layout_data.has_hfw = _layout_data.has_hfw || item.hasHeightForWidth();
}
- safeAdd(min_size.x(), _layout_data.padding);
- safeAdd(max_size.x(), _layout_data.padding);
- safeAdd(size_hint.x(), _layout_data.padding);
+ SGMisc<int>::addClipOverflowInplace(min_size.x(), _layout_data.padding);
+ SGMisc<int>::addClipOverflowInplace(max_size.x(), _layout_data.padding);
+ SGMisc<int>::addClipOverflowInplace(size_hint.x(), _layout_data.padding);
_layout_data.min_size = min_size.x();
_layout_data.max_size = max_size.x();
return _max_size;
}
+
+ //----------------------------------------------------------------------------
+ int BoxLayout::heightForWidthImpl(int w) const
+ {
+ if( !hasHeightForWidth() )
+ return -1;
+
+ updateWFHCache(w);
+ return _hfw_height;
+ }
+
+ //----------------------------------------------------------------------------
+ int BoxLayout::minimumHeightForWidthImpl(int w) const
+ {
+ if( !hasHeightForWidth() )
+ return -1;
+
+ updateWFHCache(w);
+ return _hfw_min_height;
+ }
+
//----------------------------------------------------------------------------
void BoxLayout::doLayout(const SGRecti& geom)
{