summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-02-27 11:15:02 +0000
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2019-02-28 22:08:37 +0100
commit8b07376f70f5e1192d9ac1e97bcf34de7a09a8a2 (patch)
treec58344f2bb368bb1b87ed237fcce49d1968179c4
parent041ee5be8aa4438b5d16930508c31c1c1e3a9626 (diff)
Resolves: tdf#123711 measure scrollbar for optimal width
Change-Id: I30225124e44e8a6290270ecba5024f36508817d3 Reviewed-on: https://gerrit.libreoffice.org/68429 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r--vcl/source/treelist/treelistbox.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx
index 6aea58ad91b4..0ece3b5eb793 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -3133,6 +3133,10 @@ Size SvTreeListBox::GetOptimalSize() const
}
long nMinWidth = nMinWidthInChars * approximate_char_width();
aRet.setWidth( std::max(aRet.Width(), nMinWidth) );
+
+ if (GetStyle() & WB_VSCROLL)
+ aRet.AdjustWidth(GetSettings().GetStyleSettings().GetScrollBarSize());
+
return aRet;
}