Kaydet (Commit) 62208797 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Miklos Vajna

implement spread button layout

Change-Id: Ia17d3f4d14319adec6b0b20dced5daf5b8018c36
(cherry picked from commit 5dc0c03f)

Resolves: fdo#59767 detect outlier widths and exclude from size normalization

For non-homogeneous (the default) button boxes we want in general to give all
buttons the same width as the max button width.

But if we detect that certain buttons are > 1.5 the average button width, then
leave those outliers at their natural size and set the rest of the buttons to
the max width of the remainder.

(cherry picked from commit 6e81082d)

Conflicts:
	vcl/source/window/layout.cxx

Change-Id: Ice514e741e3a7725d69e150e5752158a1c267141
Reviewed-on: https://gerrit.libreoffice.org/1973Reviewed-by: 's avatarMiklos Vajna <vmiklos@suse.cz>
Tested-by: 's avatarMiklos Vajna <vmiklos@suse.cz>
üst 6769538b
......@@ -201,9 +201,8 @@ class VCL_DLLPUBLIC VclButtonBox : public VclBox
{
public:
VclButtonBox(Window *pParent, int nSpacing)
: VclBox(pParent, true, nSpacing)
: VclBox(pParent, false, nSpacing)
, m_eLayoutStyle(VCL_BUTTONBOX_DEFAULT_STYLE)
, m_bHomogeneousGroups(false)
{
}
void set_layout(VclButtonBoxStyle eStyle)
......@@ -218,20 +217,15 @@ public:
protected:
virtual Size calculateRequisition() const;
virtual void setAllocation(const Size &rAllocation);
Size addSpacing(const Size &rSize, sal_uInt16 nVisibleChildren) const;
private:
VclButtonBoxStyle m_eLayoutStyle;
bool m_bHomogeneousGroups;
struct Requisition
{
sal_uInt16 m_nMainGroupChildren;
sal_uInt16 m_nSubGroupChildren;
std::vector<long> m_aMainGroupDimensions;
std::vector<long> m_aSubGroupDimensions;
Size m_aMainGroupSize;
Size m_aSubGroupSize;
Requisition()
: m_nMainGroupChildren(0)
, m_nSubGroupChildren(0)
{
}
};
Requisition calculatePrimarySecondaryRequisitions() const;
Size addReqGroups(const VclButtonBox::Requisition &rReq) const;
......
This diff is collapsed.
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