| commit | d66fb70959b13dd822664867c363591b2c401767 | [log] |
|---|---|---|
| author | Caolán McNamara <caolanm@redhat.com> | Thu May 05 14:24:16 2022 +0100 |
| committer | Caolán McNamara <caolanm@redhat.com> | Thu May 05 21:42:09 2022 +0200 |
| tree | 0a63b038af82e39abb0a1353c00b50afe7c89071 | |
| parent | 869a5897cfe8de5f69b2a72f296a443467907c02 [diff] |
tdf#148771 in scrollable dropdowns show some lines before selected entry and don't just position with the selected entry at the top so it's quick to pick preceeding adjacent entries Change-Id: I20103200c34037fb02b3c0dcc29d154c1197549d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133893 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index 1391008..fa01c64 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx
@@ -1876,6 +1876,11 @@ void ImplListBoxWindow::SetTopEntry( sal_Int32 nTop ) void ImplListBoxWindow::ShowProminentEntry( sal_Int32 nEntryPos ) { sal_Int32 nPos = nEntryPos; auto nWHeight = PixelToLogic( GetSizePixel() ).Height(); while( nEntryPos > 0 && maEntryList.GetAddedHeight( nPos+1, nEntryPos ) < nWHeight/2 ) nEntryPos--; SetTopEntry( nEntryPos ); }