summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2020-04-26 05:38:01 +0530
committerDennis Francis <dennis.francis@collabora.com>2020-04-29 19:55:15 +0200
commit7e841c7e6546a6a3861c2d45ffc28fd427d0c597 (patch)
tree53f2ff4de3dc809d94a1de0ade2abaf3867db22a /sc/source/ui
parent3405f7f1b19738cad57b58259105ec87c1108466 (diff)
lokit: trim validation dropdown height to content
The validation dropdown looks ugly for lists with small number of items as its height is hardcoded to SC_FILTERLISTBOX_LINES(=12) * TextHeight Instead lets use the number of entries in the list to determine the height if this count is less than SC_FILTERLISTBOX_LINES Change-Id: If026140044e6665159cd616c13a2eb57356ae53f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92914 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Dennis Francis <dennis.francis@collabora.com> (cherry picked from commit adf10bae8aecd8b765a21660b31056292276bdb2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93066 Tested-by: Jenkins
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/view/gridwin.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index b14ffb1f9a43..98b025f6cf61 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1138,9 +1138,13 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow )
// minimum width in pixel
const long nMinLOKWinWidth = static_cast<long>(1.3 * STD_COL_WIDTH * pViewData->GetPPTX());
- if (comphelper::LibreOfficeKit::isActive() && nSizeX < nMinLOKWinWidth)
+ bool bLOKActive = comphelper::LibreOfficeKit::isActive();
+ if (bLOKActive && nSizeX < nMinLOKWinWidth)
nSizeX = nMinLOKWinWidth;
+ if (bLOKActive && aStrings.size() < SC_FILTERLISTBOX_LINES)
+ nHeight = nHeight * (aStrings.size() + 1) / SC_FILTERLISTBOX_LINES;
+
Size aParentSize = GetParent()->GetOutputSizePixel();
Size aSize( nSizeX, nHeight );