vcl/source/window/layout.cxx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
New commits: commit 9c0b035c617b0ee4095e673e756d0a93df7864a3 Author: Caolán McNamara <caol...@redhat.com> Date: Thu Aug 15 10:22:50 2013 +0100 calculate outliers before apply min button size this is more gtk-alike and gives a better balance in e.g. insert->envelope/file->new->label and hopefully helps reduce the Polish "standard" button width problem in paragraph style dialog Change-Id: Ibe3b93d45d867f95fd2f6550a3ee954143f690aa (cherry picked from commit 28293f6f28e704ef9aea34c755051b1df005a5d8) Reviewed-on: https://gerrit.libreoffice.org/5433 Reviewed-by: Fridrich Strba <fridr...@documentfoundation.org> Tested-by: Fridrich Strba <fridr...@documentfoundation.org> diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index a83a722..64787d2 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -361,7 +361,7 @@ static long getMaxNonOutlier(const std::vector<long> &rG, long nAvgDimension) } static std::vector<long> setButtonSizes(const std::vector<long> &rG, - long nAvgDimension, long nMaxNonOutlier) + long nAvgDimension, long nMaxNonOutlier, long nMinWidth) { std::vector<long> aVec; //set everything < 1.5 times the average to the same width, leave the @@ -371,9 +371,13 @@ static std::vector<long> setButtonSizes(const std::vector<long> &rG, { long nPrimaryChildDimension = *aI; if (nPrimaryChildDimension < nAvgDimension * 1.5) - aVec.push_back(nMaxNonOutlier); + { + aVec.push_back(std::max(nMaxNonOutlier, nMinWidth)); + } else - aVec.push_back(nPrimaryChildDimension); + { + aVec.push_back(std::max(nPrimaryChildDimension, nMinWidth)); + } } return aVec; } @@ -405,12 +409,12 @@ VclButtonBox::Requisition VclButtonBox::calculatePrimarySecondaryRequisitions() //set the max secondary dimension nMainGroupSecondary = std::max(nMainGroupSecondary, getSecondaryDimension(aChildSize)); //collect the primary dimensions - aMainGroupSizes.push_back(std::max(nMinMainGroupPrimary, getPrimaryDimension(aChildSize))); + aMainGroupSizes.push_back(getPrimaryDimension(aChildSize)); } else { nSubGroupSecondary = std::max(nSubGroupSecondary, getSecondaryDimension(aChildSize)); - aSubGroupSizes.push_back(std::max(nMinSubGroupPrimary, getPrimaryDimension(aChildSize))); + aSubGroupSizes.push_back(getPrimaryDimension(aChildSize)); } } @@ -418,8 +422,10 @@ VclButtonBox::Requisition VclButtonBox::calculatePrimarySecondaryRequisitions() { long nMaxMainDimension = aMainGroupSizes.empty() ? 0 : *std::max_element(aMainGroupSizes.begin(), aMainGroupSizes.end()); + nMaxMainDimension = std::max(nMaxMainDimension, nMinMainGroupPrimary); long nMaxSubDimension = aSubGroupSizes.empty() ? 0 : *std::max_element(aSubGroupSizes.begin(), aSubGroupSizes.end()); + nMaxSubDimension = std::max(nMaxSubDimension, nMinSubGroupPrimary); long nMaxDimension = std::max(nMaxMainDimension, nMaxSubDimension); aReq.m_aMainGroupDimensions.resize(aMainGroupSizes.size(), nMaxDimension); aReq.m_aSubGroupDimensions.resize(aSubGroupSizes.size(), nMaxDimension); @@ -446,9 +452,9 @@ VclButtonBox::Requisition VclButtonBox::calculatePrimarySecondaryRequisitions() long nMaxNonOutlier = std::max(nMaxMainNonOutlier, nMaxSubNonOutlier); aReq.m_aMainGroupDimensions = setButtonSizes(aMainGroupSizes, - nAvgDimension, nMaxNonOutlier); + nAvgDimension, nMaxNonOutlier, nMinMainGroupPrimary); aReq.m_aSubGroupDimensions = setButtonSizes(aSubGroupSizes, - nAvgDimension, nMaxNonOutlier); + nAvgDimension, nMaxNonOutlier, nMinSubGroupPrimary); } if (!aReq.m_aMainGroupDimensions.empty())
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits