vcl/source/control/imivctl.hxx  |    1 -
 vcl/source/control/imivctl1.cxx |   17 -----------------
 2 files changed, 18 deletions(-)

New commits:
commit aebf3d38201521905f6b6739b723f04bb4e93c22
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Jul 23 11:48:53 2024 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Jul 24 05:45:34 2024 +0200

    tdf#161501 icon choice ctrl: Don't modify bound rect to center content
    
    Don't modify the bound rect of tab items used used e.g.
    for drawing the focus/selection/mouse-hover rectangles/indicators
    in order to center the content horizontally and vertically.
    
    Making the bound rect smaller in vertical direction
    in `SvxIconChoiceCtrl_Impl::Center` resulted in margins
    between entries for the non-native drawing path (e.g. the
    gen VCL plugin on Linux) for the text-only case
    (e.g. "Format" -> "Page Style" dialog in Writer).
    
    Making sure that the content is centered should rather
    happen in the drawing routine.
    
    Horizontally centering already happens for the icon-case
    anyway, as the `PAINTFLAG_VER_CENTERED` gets passed as flag
    to the `PaintItem` call for the `WB_ICON` case in
    `SvxIconChoiceCtrl_Impl::PaintEntry` anyway.
    
    And for text-only mode, which was apparently the only one
    for which centering vertically in `SvxIconChoiceCtrl_Impl::Center`
    had an effect, vertically drawing text was implemented in the drawing
    code path in
    
        commit 180f0c1ec8e195043b5f4298737a219026a8b944
        Author: Rafael Lima <rafael.palma.l...@gmail.com>
        Date:   Tue Jul 16 20:52:28 2024 +0200
    
            tdf#161501 Improve visuals of selected entries in Vertical tabs
    
    . This commit addresses the
    
    >   For the gen VCL plugin, there's still a small gap between
    >   text-only items (e.g. in the "Format" -> "Page Style" dialog
    >   which has a different cause and will be addressed in a separate
    >   commit.
    
    aspect mentioned in earlier commit
    
        Change-Id: Iac34098ef8d0f90f1ac0844df63839a6a99b83a7
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Mon Jul 22 11:39:48 2024 +0200
    
            tdf#161501 icon choice ctrl: Drop extra space between items
    
    Change-Id: I2077efc8ce1e97d52cf078d63bb4e4b528e389eb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170895
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx
index ae767baf4e50..9388208c0574 100644
--- a/vcl/source/control/imivctl.hxx
+++ b/vcl/source/control/imivctl.hxx
@@ -165,7 +165,6 @@ class SvxIconChoiceCtrl_Impl
                         }
     void                InitScrollBarBox();
     void                DeselectAllBut( SvxIconChoiceCtrlEntry const * );
-    void                Center( SvxIconChoiceCtrlEntry* pEntry ) const;
 
     tools::Rectangle           CalcMaxTextRect( const SvxIconChoiceCtrlEntry* 
pEntry ) const;
 
diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index f5f1767ba019..6061f83b2773 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1265,7 +1265,6 @@ void SvxIconChoiceCtrl_Impl::FindBoundingRect( 
SvxIconChoiceCtrlEntry* pEntry )
 
     tools::Rectangle aGridRect(aPos, Size(nGridDX, nGridDY));
     pEntry->aRect = aGridRect;
-    Center( pEntry );
     AdjustVirtSize( pEntry->aRect );
     pGridMap->OccupyGrids( pEntry );
 }
@@ -1634,22 +1633,6 @@ void SvxIconChoiceCtrl_Impl::SetDefaultTextSize()
     aDefaultTextSize = Size(nDX, nDY);
 }
 
-
-void SvxIconChoiceCtrl_Impl::Center( SvxIconChoiceCtrlEntry* pEntry ) const
-{
-    Size aSize( CalcBoundingSize() );
-    if( nWinBits & WB_ICON )
-    {
-        // center horizontally
-        tools::Long nBorder = pEntry->aRect.GetWidth() - aSize.Width();
-        pEntry->aRect.AdjustLeft(nBorder / 2 );
-        pEntry->aRect.AdjustRight( -(nBorder / 2) );
-    }
-    // center vertically
-    pEntry->aRect.SetBottom( pEntry->aRect.Top() + aSize.Height() );
-}
-
-
 // The deltas are the offsets by which the view is moved on the document.
 // left, up: offsets < 0
 // right, down: offsets > 0

Reply via email to