Kaydet (Commit) d00ee312 authored tarafından Caolán McNamara's avatar Caolán McNamara

honour widget [v|h]expand in VclBox as well as packing expand

Change-Id: I5ccd28c8d9d62d5a7bec118312752f66a9a4d609
üst 77d6f58d
...@@ -86,6 +86,8 @@ protected: ...@@ -86,6 +86,8 @@ protected:
virtual void setSecondaryDimension(Size &rSize, long) const = 0; virtual void setSecondaryDimension(Size &rSize, long) const = 0;
virtual long getSecondaryCoordinate(const Point &rPos) const = 0; virtual long getSecondaryCoordinate(const Point &rPos) const = 0;
virtual void setSecondaryCoordinate(Point &rPos, long) const = 0; virtual void setSecondaryCoordinate(Point &rPos, long) const = 0;
virtual bool getPrimaryDimensionChildExpand(const Window &rWindow) const = 0;
}; };
class VCL_DLLPUBLIC VclVBox : public VclBox class VCL_DLLPUBLIC VclVBox : public VclBox
...@@ -128,6 +130,10 @@ protected: ...@@ -128,6 +130,10 @@ protected:
{ {
rPos.setX(nPos); rPos.setX(nPos);
} }
virtual bool getPrimaryDimensionChildExpand(const Window &rWindow) const
{
return rWindow.get_expand() || rWindow.get_vexpand();
}
}; };
class VCL_DLLPUBLIC VclHBox : public VclBox class VCL_DLLPUBLIC VclHBox : public VclBox
...@@ -170,6 +176,10 @@ protected: ...@@ -170,6 +176,10 @@ protected:
{ {
rPos.setY(nPos); rPos.setY(nPos);
} }
virtual bool getPrimaryDimensionChildExpand(const Window &rWindow) const
{
return rWindow.get_expand() || rWindow.get_hexpand();
}
}; };
enum VclButtonBoxStyle enum VclButtonBoxStyle
...@@ -262,6 +272,10 @@ protected: ...@@ -262,6 +272,10 @@ protected:
{ {
rPos.setX(nPos); rPos.setX(nPos);
} }
virtual bool getPrimaryDimensionChildExpand(const Window &rWindow) const
{
return rWindow.get_expand() || rWindow.get_vexpand();
}
}; };
class VCL_DLLPUBLIC VclHButtonBox : public VclButtonBox class VCL_DLLPUBLIC VclHButtonBox : public VclButtonBox
...@@ -304,6 +318,10 @@ protected: ...@@ -304,6 +318,10 @@ protected:
{ {
rPos.setY(nPos); rPos.setY(nPos);
} }
virtual bool getPrimaryDimensionChildExpand(const Window &rWindow) const
{
return rWindow.get_expand() || rWindow.get_hexpand();
}
}; };
class VCL_DLLPUBLIC VclGrid : public VclContainer class VCL_DLLPUBLIC VclGrid : public VclContainer
......
...@@ -130,7 +130,7 @@ void VclBox::setAllocation(const Size &rAllocation) ...@@ -130,7 +130,7 @@ void VclBox::setAllocation(const Size &rAllocation)
if (!pChild->IsVisible()) if (!pChild->IsVisible())
continue; continue;
++nVisibleChildren; ++nVisibleChildren;
bool bExpand = pChild->get_expand(); bool bExpand = getPrimaryDimensionChildExpand(*pChild);
if (bExpand) if (bExpand)
++nExpandChildren; ++nExpandChildren;
} }
...@@ -181,7 +181,7 @@ void VclBox::setAllocation(const Size &rAllocation) ...@@ -181,7 +181,7 @@ void VclBox::setAllocation(const Size &rAllocation)
aBoxSize = getLayoutRequisition(*pChild); aBoxSize = getLayoutRequisition(*pChild);
long nPrimaryDimension = getPrimaryDimension(aBoxSize); long nPrimaryDimension = getPrimaryDimension(aBoxSize);
nPrimaryDimension += nPadding * 2; nPrimaryDimension += nPadding * 2;
if (pChild->get_expand()) if (getPrimaryDimensionChildExpand(*pChild))
nPrimaryDimension += nExtraSpace; nPrimaryDimension += nExtraSpace;
setPrimaryDimension(aBoxSize, nPrimaryDimension); setPrimaryDimension(aBoxSize, nPrimaryDimension);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment