diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-10-24 10:30:28 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-10-24 15:39:27 +0100 |
commit | 88fe7d133b0597f7b18146589017af33877baf80 (patch) | |
tree | 72a18a867e207d8969bdb961e8e83677bc85e3fb /vcl/inc | |
parent | 0853819285861e896e370bb5c10bf9108f3d74d8 (diff) |
refactor buttonbox calculations to allow nonhomogeneous buttons
Change-Id: If0f3c09a2fb6577615f33576fee1dde5b627ca82
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/vcl/layout.hxx | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/vcl/inc/vcl/layout.hxx b/vcl/inc/vcl/layout.hxx index fb533dbc9e32..0e2d65d7d568 100644 --- a/vcl/inc/vcl/layout.hxx +++ b/vcl/inc/vcl/layout.hxx @@ -45,7 +45,6 @@ private: class VCL_DLLPUBLIC VclBox : public VclContainer { protected: - Size m_aMinChildSize; bool m_bHomogeneous; int m_nSpacing; public: @@ -73,6 +72,7 @@ public: } virtual bool set_property(const OString &rKey, const OString &rValue); protected: + void accumulateMaxes(const Size &rChildSize, Size &rSize) const; Size finalizeMaxes(const Size &rSize, sal_uInt16 nVisibleChildren) const; virtual Size calculateRequisition() const; @@ -185,7 +185,12 @@ enum VclButtonBoxStyle class VCL_DLLPUBLIC VclButtonBox : public VclBox { public: - VclButtonBox(Window *pParent, int nSpacing); + VclButtonBox(Window *pParent, int nSpacing) + : VclBox(pParent, true, nSpacing) + , m_eLayoutStyle(VCL_BUTTONBOX_DEFAULT_STYLE) + , m_bHomogeneousGroups(false) + { + } void set_layout(VclButtonBoxStyle eStyle) { m_eLayoutStyle = eStyle; @@ -200,18 +205,21 @@ protected: virtual void setAllocation(const Size &rAllocation); private: VclButtonBoxStyle m_eLayoutStyle; + bool m_bHomogeneousGroups; struct Requisition { - sal_uInt16 m_nPrimaryChildren; - sal_uInt16 m_nSecondaryChildren; - Size m_aSize; + sal_uInt16 m_nMainGroupChildren; + sal_uInt16 m_nSubGroupChildren; + Size m_aMainGroupSize; + Size m_aSubGroupSize; Requisition() - : m_nPrimaryChildren(0) - , m_nSecondaryChildren(0) + : m_nMainGroupChildren(0) + , m_nSubGroupChildren(0) { } }; Requisition calculatePrimarySecondaryRequisitions() const; + Size addReqGroups(const VclButtonBox::Requisition &rReq) const; }; class VCL_DLLPUBLIC VclVButtonBox : public VclButtonBox |