summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2023-05-22 13:53:25 -0400
committerJustin Luth <jluth@mail.com>2023-05-24 19:50:44 +0200
commit2cdb48eee93a3a93074184c5c8a82e571fb0bd04 (patch)
treeea30c3b72bd1a3ca3b2873a6dc7f35b5eb85b7b3 /vcl
parentfd6cbd983a3021d22321854d0414bdc42c6cb1b7 (diff)
tdf#141684 tdf#147740 notebookbar: fix disappearing icons in groupbar #2
AFAICS, the code was non-sensical before. Hopefully now it is logical. Apparently returning the correct width doesn't mean much, but that is the only thing that should be changing in this patch. I would assume that returning an accurate width is the proper thing to do for this function... Change-Id: Iab26ac7fd8cd00127d2646f792fa552ec148dc74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152126 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/PriorityMergedHBox.cxx28
1 files changed, 10 insertions, 18 deletions
diff --git a/vcl/source/control/PriorityMergedHBox.cxx b/vcl/source/control/PriorityMergedHBox.cxx
index 3e67a13a8f4a..fd5aa5814dac 100644
--- a/vcl/source/control/PriorityMergedHBox.cxx
+++ b/vcl/source/control/PriorityMergedHBox.cxx
@@ -144,31 +144,23 @@ Size PriorityMergedHBox::calculateRequisition() const
sal_uInt16 nVisibleChildren = 0;
Size aSize;
- for (vcl::Window* pChild = GetWindow(GetWindowType::FirstChild); pChild;
- pChild = pChild->GetWindow(GetWindowType::Next))
- {
- if (!pChild->IsVisible())
- continue;
- ++nVisibleChildren;
- Size aChildSize = getLayoutRequisition(*pChild);
-
- tools::Long nPrimaryDimension = getPrimaryDimension(aChildSize);
- nPrimaryDimension += pChild->get_padding() * 2;
- setPrimaryDimension(aChildSize, nPrimaryDimension);
-
- accumulateMaxes(aChildSize, aSize);
- }
-
- // find max height
+ // find max height and total width
for (vcl::Window* pChild = GetWindow(GetWindowType::FirstChild); pChild;
pChild = pChild->GetWindow(GetWindowType::Next))
{
Size aChildSize = getLayoutRequisition(*pChild);
- setPrimaryDimension(aChildSize, getPrimaryDimension(aSize));
+ if (!pChild->IsVisible())
+ setPrimaryDimension(aChildSize, 0);
+ else
+ {
+ ++nVisibleChildren;
+ tools::Long nPrimaryDimension = getPrimaryDimension(aChildSize);
+ nPrimaryDimension += pChild->get_padding() * 2;
+ setPrimaryDimension(aChildSize, nPrimaryDimension);
+ }
accumulateMaxes(aChildSize, aSize);
}
- setPrimaryDimension(aSize, 200);
return finalizeMaxes(aSize, nVisibleChildren);
}