vcl/source/control/imivctl1.cxx | 27 +++++++++++++++------------ vcl/source/control/ivctrl.cxx | 4 ++-- 2 files changed, 17 insertions(+), 14 deletions(-)
New commits: commit f6ea343e6fb2dc3539823dee60c9c6f96fc16275 Author: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> AuthorDate: Thu May 30 12:26:11 2024 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Jun 3 09:32:06 2024 +0200 tdf#161030 Improve vertical Tab list display * Increase width a bit to allow for longer tab names * Avoid jumping while moving through the list with arrow keys Change-Id: Ie418dd40c5f69dcdea8fa07743ff26e3c9e04ee2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168251 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index ea69fbcfb99b..dca91c7d4163 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -92,7 +92,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( aVisRectChangedIdle.SetInvokeHandler(LINK(this,SvxIconChoiceCtrl_Impl,VisRectChangedHdl)); Clear( true ); - Size gridSize((nWinStyle & WB_DETAILS) ? 200 : 100, (nWinStyle & WB_DETAILS) ? 20 : 70); + Size gridSize((nWinStyle & WB_DETAILS) ? 150 : 100, (nWinStyle & WB_DETAILS) ? 20 : 70); if(pView->GetDPIScaleFactor() > 1) { gridSize.setHeight( gridSize.Height() * ( pView->GetDPIScaleFactor()) ); @@ -1942,19 +1942,22 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const tools::Rectangle& rRect, bool bS else nDy = 0; - tools::Long nDx; - if( aVirtRect.Left() < aOutputArea.Left() ) - { - // scroll to the left (nDx < 0) - nDx = aVirtRect.Left() - aOutputArea.Left(); - } - else if( aVirtRect.Right() > aOutputArea.Right() ) + tools::Long nDx = 0; + + // no horizontal scrolling needed in list mode + if (!(nWinBits & WB_DETAILS)) { - // scroll to the right (nDx > 0) - nDx = aVirtRect.Right() - aOutputArea.Right(); + if( aVirtRect.Left() < aOutputArea.Left() ) + { + // scroll to the left (nDx < 0) + nDx = aVirtRect.Left() - aOutputArea.Left(); + } + else if( aVirtRect.Right() > aOutputArea.Right() ) + { + // scroll to the right (nDx > 0) + nDx = aVirtRect.Right() - aOutputArea.Right(); + } } - else - nDx = 0; aOrigin.AdjustX(nDx ); aOrigin.AdjustY(nDy ); diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index cb0c4e33d0c3..c17a0caf359d 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -447,9 +447,9 @@ VerticalTabControl::VerticalTabControl(vcl::Window* pParent, bool bWithIcons) SetType(WindowType::VERTICALTABCONTROL); m_xChooser->SetSelectionMode(SelectionMode::Single); m_xChooser->SetClickHdl(LINK(this, VerticalTabControl, ChosePageHdl_Impl)); - m_xChooser->set_width_request(110); + m_xChooser->set_width_request(150); m_xChooser->set_height_request(400); - m_xChooser->SetSizePixel(Size(110, 400)); + m_xChooser->SetSizePixel(Size(150, 400)); m_xBox->set_vexpand(true); m_xBox->set_hexpand(true); m_xBox->set_expand(true);