From 50547d359ff5229da1108b097612412bb06a3000 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 30 Jan 2019 16:32:01 +0000 Subject: tdf#115941 use max of scrollbar and statusbar height for record locater MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I639fd1c593e7cc440de5d2038562e64eab1a5af6 Reviewed-on: https://gerrit.libreoffice.org/67164 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- svtools/source/brwbox/brwbox1.cxx | 8 +++++--- svtools/source/brwbox/brwbox2.cxx | 19 ++++++++++++++----- 2 files changed, 19 insertions(+), 8 deletions(-) (limited to 'svtools') diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 12b9e2c54aef..67e73f26a492 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -111,6 +111,7 @@ BrowseBox::BrowseBox( vcl::Window* pParent, WinBits nBits, BrowserMode nMode ) ,DragSourceHelper( this ) ,DropTargetHelper( this ) ,aHScroll( VclPtr::Create(this, WB_HSCROLL) ) + ,aStatusBar( VclPtr::Create(this) ) { ConstructImpl( nMode ); } @@ -137,6 +138,7 @@ void BrowseBox::dispose() pDataWin.disposeAndClear(); pVScroll.disposeAndClear(); aHScroll.disposeAndClear(); + aStatusBar.disposeAndClear(); // free columns-space mvCols.clear(); @@ -2076,11 +2078,11 @@ bool BrowseBox::ReserveControlArea(sal_uInt16 nWidth) tools::Rectangle BrowseBox::GetControlArea() const { - + auto nHeight = aHScroll->GetSizePixel().Height(); return tools::Rectangle( - Point( 0, GetOutputSizePixel().Height() - aHScroll->GetSizePixel().Height() ), + Point( 0, GetOutputSizePixel().Height() - nHeight ), Size( GetOutputSizePixel().Width() - aHScroll->GetSizePixel().Width(), - aHScroll->GetSizePixel().Height() ) ); + nHeight ) ); } void BrowseBox::SetMode( BrowserMode nMode ) diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 8af97408a2d7..f2aa331e18b7 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -475,9 +475,7 @@ void BrowseBox::Resize() pDataWin->bResizeOnPaint = false; // calc the size of the scrollbars - // (we can't ask the scrollbars for their widths cause if we're zoomed they still have to be - // resized - which is done in UpdateScrollbars) - sal_uLong nSBSize = GetSettings().GetStyleSettings().GetScrollBarSize(); + sal_uLong nSBSize = GetBarHeight(); if (IsZoom()) nSBSize = static_cast(nSBSize * static_cast(GetZoom())); @@ -1028,6 +1026,17 @@ void BrowseBox::PaintData( vcl::Window const & rWin, vcl::RenderContext& rRender ImplPaintData(rRenderContext, rRect, false); } +long BrowseBox::GetBarHeight() const +{ + // tdf#115941 because some platforms have things like overlay scrollbars, take a max + // of a statusbar height and a scrollbar height as the control area height + + // (we can't ask the scrollbars for their size cause if we're zoomed they still have to be + // resized - which is done in UpdateScrollbars) + + return std::max(aStatusBar->GetSizePixel().Height(), GetSettings().GetStyleSettings().GetScrollBarSize()); +} + void BrowseBox::UpdateScrollbars() { @@ -1043,7 +1052,7 @@ void BrowseBox::UpdateScrollbars() pDataWin->bInUpdateScrollbars = true; // the size of the corner window (and the width of the VSB/height of the HSB) - sal_uLong nCornerSize = GetSettings().GetStyleSettings().GetScrollBarSize(); + sal_uLong nCornerSize = GetBarHeight(); if (IsZoom()) nCornerSize = static_cast(nCornerSize * static_cast(GetZoom())); @@ -1940,7 +1949,7 @@ tools::Rectangle BrowseBox::calcTableRect(bool _bOnScreen) long nY = aRowBar.Top() - aRect.Top(); Size aSize(aRect.GetSize()); - return tools::Rectangle(aRowBar.TopRight(), Size(aSize.Width() - nX, aSize.Height() - nY - aHScroll->GetSizePixel().Height()) ); + return tools::Rectangle(aRowBar.TopRight(), Size(aSize.Width() - nX, aSize.Height() - nY - GetBarHeight()) ); } tools::Rectangle BrowseBox::GetFieldRectPixelAbs( sal_Int32 _nRowId, sal_uInt16 _nColId, bool /*_bIsHeader*/, bool _bOnScreen ) -- cgit