vcl/source/control/imivctl1.cxx |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 92c30fd8320cd340a0daaac3a45475cbea4c3e99
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Jul 12 08:43:10 2024 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Jul 15 11:36:54 2024 +0200

    tdf#161501 icon choice ctrl: Highlight full entry area
    
    For background and borders/frames drawn to highlight
    the currently selected/focused/mouse-hovered entry in
    the icon choice control, use the entry's full area
    and don't restrict the bottom edge to where the text
    ends.
    
    It's also unclear to me why 1 pixel would be subtracted
    for the top and right edge when calculating the rect -
    drop that as well.
    (There is a line of a pixel or so in between the entries,
    but since that actually doesn't belong to any of the
    entries -- clicking there doesn't change the selected
    entry -- also don't highlight it as part of one of the
    entries.)
    
    This addresses this (preexisting) issue mentioned in [1]:
    
    > Maybe for a future patch... but the height from `CalcFocusRect`
    > is too low. It barely covers the item and leaves gaps with
    > respect to subsequent items.
    
    [1] 
https://gerrit.libreoffice.org/c/core/+/170341/comment/57dc568d_1c0a8cf2/
    
    Change-Id: I3369401c0bbdb77a054da9f57ac70f30f97c9cca
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170393
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Reviewed-by: Rafael Lima <rafael.palma.l...@gmail.com>
    Tested-by: Jenkins

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index aa935c22632f..ed76c87cc80b 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1711,16 +1711,13 @@ const Size& SvxIconChoiceCtrl_Impl::GetItemSize( 
IcnViewFieldType eItem ) const
 
 tools::Rectangle SvxIconChoiceCtrl_Impl::CalcFocusRect( 
SvxIconChoiceCtrlEntry* pEntry )
 {
-    tools::Rectangle aTextRect( CalcTextRect( pEntry ) );
     tools::Rectangle aBoundRect( GetEntryBoundRect( pEntry ) );
 
     // Remove left margin
     if (nWinBits & WB_DETAILS)
         aBoundRect.SetPos(Point(0, aBoundRect.GetPos().Y()));
 
-    return tools::Rectangle(
-        aBoundRect.Left(), aBoundRect.Top() - 1, aBoundRect.Right() - 1,
-        aTextRect.Bottom());
+    return aBoundRect;
 }
 
 IMPL_LINK_NOARG(SvxIconChoiceCtrl_Impl, VisRectChangedHdl, Timer *, void)

Reply via email to